Mixed machine learning architecture

ABSTRACT

A preprocessing module of a neural network has a first input and second input. The module generates multiple, different first latent vector representations of its first input, and multiple, different second latent vector representations of its second input. The module then models pairwise interactions between every unique pairwise combination of the first and second latent vector representations. The module then produces an intermediate output by combining the results of the modeled pairwise interactions.

TECHNICAL FIELD

This disclosure generally relates to neural network (NN) machinelearning (ML) model architectures, methods/systems for training the MLmodels, and methods/systems for implementing the ML models.

BACKGROUND

A social-networking system, which may include a social-networkingwebsite, may enable its users (such as persons or organizations) tointeract with it and with each other through it. The social-networkingsystem may, with input from a user, create and store in thesocial-networking system a user profile associated with the user. Theuser profile may include demographic information, communication-channelinformation, and information on personal interests of the user. Thesocial-networking system may also, with input from a user, create andstore a record of relationships of the user with other users of thesocial-networking system, as well as provide services (e.g., wall posts,photo-sharing, event organization, messaging, games, or advertisements)to facilitate social interaction between or among users.

The social-networking system may use an machine learning model toidentify content or messages of interest to the user based on variouscriteria/input sources, such as for example, a user's input, a user'sprofile, a user's social graph (described below), etc. Thesocial-networking system may send over one or more networks the contentor messages, which may be related to its services, to a mobile or othercomputing device of a user. A user may also install softwareapplications on a mobile or other computing device of the user foraccessing a user profile of the user and other data within thesocial-networking system. The social-networking system may generate apersonalized set of content objects to display to a user, such as anewsfeed of aggregated stories of other users connected to the user.

A mobile computing device—such as a smartphone, tablet computer, orlaptop computer—may include functionality for determining its location,direction, or orientation, such as a GPS receiver, compass, gyroscope,or accelerometer. Such a device may also include functionality forwireless communication, such as BLUETOOTH communication, near-fieldcommunication (NFC), or infrared (IR) communication or communicationwith a wireless local area networks (WLANs) or cellular-telephonenetwork. Such a device may also include one or more cameras, scanners,touchscreens, microphones, or speakers. Mobile computing devices mayalso execute software applications, such as games, web browsers, orsocial-networking applications. With social-networking applications,users may connect, communicate, and share information with other usersin their social networks.

SUMMARY OF PARTICULAR EMBODIMENTS

In particular embodiments, a computing device (e.g., a server computingmachine), may access a neural network (NN) machine learning (ML) modelthat includes a (preprocessing) module (e.g., a preprocessingblock/module that may process input data and place the data in a formatbetter suited for further processing within the NN ML model). Theaccessed neural network model may be a multi-layer perception (MLP) NNarchitecture/model. The accessed module may have a first (vector) inputand a second (vector) input, and the computing device may process theaccessed module to generate multiple, different, first latent vectorrepresentations (e.g. different first embeddings) of the first input,and generate multiple, different, second latent vector representations(e.g. different second embeddings) of the second input. Processing ofthe accessed module by the computing device may further produce modeledpairwise interactions (e.g., dot products or cosine similarities)between unique pairwise combinations of the first latent vectorrepresentations and the second latent vector representations, andproduces an intermediate output of the module by combining (e.g., byconcatenation) results of the modeled pairwise interactions.

The embodiments disclosed herein are only examples, and the scope ofthis disclosure is not limited to them. Particular embodiments mayinclude all, some, or none of the components, elements, features,functions, operations, or steps of the embodiments disclosed above.Embodiments according to the invention are in particular disclosed inthe attached claims directed to a method, a storage medium, a system anda computer program product, wherein any feature mentioned in one claimcategory, e.g. method, can be claimed in another claim category, e.g.system, as well. The dependencies or references back in the attachedclaims are chosen for formal reasons only. However any subject matterresulting from a deliberate reference back to any previous claims (inparticular multiple dependencies) can be claimed as well, so that anycombination of claims and the features thereof are disclosed and can beclaimed regardless of the dependencies chosen in the attached claims.The subject-matter which can be claimed comprises not only thecombinations of features as set out in the attached claims but also anyother combination of features in the claims, wherein each featurementioned in the claims can be combined with any other feature orcombination of other features in the claims. Furthermore, any of theembodiments and features described or depicted herein can be claimed ina separate claim and/or in any combination with any embodiment orfeature described or depicted herein or with any of the features of theattached claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example of a multilayer perception (MLP) neuralnetwork.

FIG. 2 shows a simplified neural network consisting of an input layer, ahidden layer, and an output layer.

FIG. 3 illustrates a method of combining a one or more dense input andone or more sparse input in a neural net.

FIG. 4 illustrates an example embedding and pooling technique.

FIG. 5 illustrates an embodiment with combined embedding and pooling ofboth dense input(s) and sparse (inputs).

FIG. 6 illustrates a nesting architecture to model higher-orderinteractions between features.

FIG. 7 illustrates an example method for a nested architecture ML model.

FIG. 8 illustrates an example mixed architecture neural network.

FIG. 9 illustrates an example method for a mixed architecture neuralnetwork.

FIG. 10 illustrates an arrangement of multiple workers and a local,shared parameter memory within a single GPU.

FIG. 11 illustrates an example implementation of a hierarchicaltwo-layer (or two-tier) trainer.

FIG. 12 illustrates another example training system for training an MLmodel.

FIG. 13 illustrates an example method for a training system to train anML model.

FIG. 14 illustrates an example operation nodal model, e.g., a nodalgraph model of a trained (NN) ML model.

FIG. 15 illustrates an example of the operation nodal model of FIG. 14divided into multiple graph-segments.

FIG. 16 illustrates an example, optimized data path flow between a localmachine and a remote machine.

FIG. 17 illustrates an example method for the operational stage of atrained ML model divided between two machines.

FIG. 18 illustrates an example network environment associated with asocial-networking system.

FIG. 19 illustrates an example social graph.

FIG. 20 illustrates an example computer system.

DESCRIPTION OF EXAMPLE EMBODIMENTS

Various machine learning (ML) architectures (or models), and approachesto training and using (operating) the ML model are herein provided.

In particular embodiments, a method and system (e.g., an ML model) isprovided for predicting an outcome based on a combination of dense andsparse (vector) inputs, where higher order relationships between theinputs may be taken into consideration as part of the prediction. Adense (vector) input may be represented by a mostly-populated vector,and in particular embodiments, may consist of determinable descriptorscommon to most users (or circumstances, depending upon a specificapplication), such as gender, time-of-day, local Wi-Fi status, etc. Anumeric value may be assigned to each descriptor (dimension or cell) inthe dense (vector) input. A sparse (vector) input may reflect moresemantic information related to a particular task objective. The sparseinput may reflect selections within a larger list(s) of options (listsmay further be divided into different categories). For example, a sparseinput may reflect a short list of webpage IDs indicating which webpages(from within a larger list (e.g., dense vector housing the larger list)of webpages) a user has visited within a predefined time frame.Consequently, the elements of a sparse vector may be mostly zero values(e.g., zero value may correspond to the not-selected options within thelarger list). In order to avoid long sequences of consecutive cellpositions having a zero value representing a not-selected option, asparse vector may be represented as a series of indexes pointing toselected positions in the larger list along with each index'scorresponding numeric (non-zero) value for that position. For example,the indexed positions may correspond to positions of non-zero values(e.g. selected IDs) within the larger list, e.g., correspond to cellpositions of selected IDs within the dense vector housing the largerlist.

In particular embodiments, a sparse neural network (NN) machine learning(ML) model and supervised training data may be used to learn variousembedding values, which may then be used to make predictions. The MLmodel may use a multi-layer perception (MLP) approach, where outputsfrom one learning layer (e.g. hidden layer) are fed forward to one ormore other learning layers. In operation, the dense and sparse inputsmay be combined (which may include replacing inputs withembedded/pooling representations) in a pre-processing stage (or module)and fed into a first learning layer (e.g., an input layer or hiddenlayer in an MLP approach). End-to-end training (such as byback-propagation) using supervised training data may be used to learnnetwork weights (e.g., parameters or gradient values) and embedding(e.g., parameter or gradient) values. An ML model may be deemed trainedwhen such parameters/gradients values have been determined, e.g., whenoutputs of the ML model agree with test output parameters to within apredefined degree.

In particular embodiments, sparse inputs may be determined based onvarious observations, or characteristics, about a user (or circumstance)or other feature input, such as reflecting an inferred preference ortendency of the user or a categorized characteristic of theuser/feature. This inference may be achieved by use of a Random Forest,or other classification or regression tool, prior to defining higherorder relationships between the inputs. For example, a feature input maybe submitted to a group of Boosted Decision Tree (BDT) trees and eachtree may provide an ID based on the leaf to which the feature inputcorresponds. In this manner, the group of BDT trees provides a list ofIDs, which together may define a sparse input.

Sparse inputs (and optionally some dense inputs) may consist of alist-of-IDs, and prior to being combined with other (vector) inputs,each input may be submitted to an Embedding-Pooling (EP) (processing)block/circuit. The embedding portion of the EP block may convert each ID(which may represent a webpage, an ad, or other category item associatedwith a user) to a vector representation in an embedding space. That is,each ID in the list-of-IDs may be replaced by an embedding (e.g., afixed-length vector of (optionally, randomly assigned) real numberswhose weights need to be learned). For example, each ID may berepresented by a 32-dimension embedding (e.g., a vector having 32 entryfields, or dimensions, or cells).

The pooling portion of the EP block may then combine the resultantembeddings into a single vector, and thereby create a more condensedrepresentation. Entries of corresponding dimensions in each embeddingmay be combined (pooled or aggregated) using a predefined pooling method(e.g., summing, averaging, max value, etc.) to define an EP outputvector of fixed length that represents the combination of all theoriginal (sparse) input(s) that received embeddings. In particularembodiments, the pooling method may apply different weights to eachembedding used in the combination. Since information may be lost duringthis aggregating process, the pooling process may be modified topreserve some/select relational information between the list-of-IDs ofan original input.

In particular embodiments, a method to preserve select relationalinformation between the list-of-IDs of an original input may includemaking use of a ranking between the IDs in a list-of-IDs based on ahistory of user interactions with the specific IDs. For example, if theIDs represent different webpages, then a ranking may be based on thefrequency with which the user visits each webpage, or shared contentfrom each webpage, or commented on each web-page, or otherwiseinteracted with each webpage. This ranking may then be used to weigh theembeddings. Additionally, a function utilizing user-based features maybe defined to assign or modify weights in the embedding.

Context information may also be used to modify embedding weights. Forexample, if a current ID within the list-of-IDs is determined to not berelevant to a current objective, then its embedding may be zeroed,effectively eliminating it from consideration. Alternatively, if an IDis strongly related to a current objective, then its embedding weightmay be increased. For example, if the “context” is defined by a specificuser ID, and prior behavior of this user has been found to be a goodindicator of future behavior in a current context, then the weight ofthe user ID's embedding may be increased.

It is to be understood that irrespective of the initialized weightsassigned to the embedding, the weights may likely change during thetraining of the ML model, and thus may not reflect final weight values.

In particular embodiments, the same sparse input (e.g., samelist-of-IDs) may be submitted to multiple EP blocks to create multiple,alternate EP output vector representations of the same sparse (vector)input. Because each EP block may assign a different, randomly selectedembedding to each ID (in the list-of-IDs that may make up a sparseinput) each time the sparse input is submitted, an alternate EP outputvector representation may be created, each different from another.

The above-mentioned, higher order relationships between inputs may bedefined in multiple preprocessing modules (or preprocessinglayers/stages), which may be linked in sequence. Within eachpreprocessing module, a combined representation may be obtained betweenevery combination of its dense input and one, two, or more sparse inputs(e.g., the EP output vector representations of its one, two, or moresparse inputs). For example, the combined representation may be obtainedby dot product or cosine similarity, both of which provide a moreexplicit way to model pairwise interactions between different features.Within each preprocessing module, the obtained combined representationsmay then be concatenated with the respective preprocessing module'soriginal dense input to define a concatenated output for the module. Forexample, a first preprocessing module may concatenate its obtained firstcombined representation with its dense input to define a firstconcatenated output, which may be submitted as a dense input to a secondpreprocessing module. The second preprocessing module may receive thesame (or different) spare inputs as the first preprocessing module, andmay generate embeddings based on the inputs, where the embeddings may bedifferent from the embeddings generated by the first preprocessingmodule, even if the two sets of embeddings were generated based on thesame sparse inputs. The second preprocessing module may concatenate itsobtained second combine representation with its dense input (the firstconcatenated output) to define a second concatenated output, which maybe treated as a third dense input to a third preprocessing module, insequence. The present process may then be repeated within the thirdpreprocessing module to define a third concatenate output that may besubmitted to a fourth preprocessing module or to a learning layer withina neural network model.

Separating the inputs into multiple preprocessing modules, and limitingthe number of inputs per preprocessing module (in a sequence ofpreprocessing modules) may help maintain computer resources (e.g.,memory requirements and processing time) manageable. Optionally, adifferent sparse input may be introduced at any preprocessing module. Ifall the unique sparse inputs are introduced in the same module, thenumber of combination operations that need to be performed (e.g., dotproduct) may be in the order of n-choose-2 (e.g., if the number ofinputs, including dense and sparse vectors, is 100, then 4950combination operations may be performed). In contrast, the frameworkdescribed above for handling higher-order interactions would limit thenumber of combination operations to be linearly related to the number ofunique sparse inputs. Alternatively, an output from one preprocessingmodule may traverse multiple preprocessing modules (in sequence) beforebeing combined with any sparse input(s) in another preprocessing module(or in a learning layer) in the sequence.

In particular embodiments, the present method may be used to identify,or predict, commercial products (e.g., ads or stories/images in anewsfeed) that a user may be interested in pursuing. The ML modelingarchitecture described above provides an efficient way for a ML model tobe trained on and make predictions based on sparse feature data.

In particular embodiments, a method and system are provided forpredicting an outcome. The method and system may include identifying (ordefining) multiple different relationships between the same pairs ofinputs, and mixing the identified multiple relationships. An exampleimplementation may use a SparseNN model (e.g., a neural network (NN)machine learning (ML) model) and supervised training data to learnvarious embedding values, which may then be used to make predictions.

The ML model may use a multi-layer perception (MLP) approach, whereoutputs from one learning layer (e.g., a hidden layer) are fed forwardto one or more other learning layer(s). In operation, a pair of inputs(including a pair of dense inputs, sparse inputs, or a combination ofboth) may be submitted to one or more preprocessing modules before beingsubmitted to a learning layer. Each preprocessing module may define arelationship between its respective pair of inputs, such as by combiningthe pair of inputs, including replacing its respective pair inputs withembedded/pooling representations prior to combining. End-to-end training(such as by back-propagation) using supervised training data may be usedto learn network weights and embedding values(weights/parameters/gradients).

In particular embodiments, each pair of inputs may consist of denseinputs, sparse inputs, or a combination of both. A dense input may berepresented by a mostly-populated vector consisting of determinabledescriptors common to most users (or circumstances, depending upon aspecific application), such as gender, time-of-day, local Wi-Fi status,etc. A numeric value may be assigned to each descriptor (dimension) inthe dense (vector) input. A sparse (vector) input may reflect moresemantic information related to a particular task objective. The sparseinput may be a vector that reflects individual selections within alarger list(s) of options (lists may further be divided into differentcategories). For example, a sparse (vector) input may reflect a shortlist of webpage IDs indicating which webpages (from within a larger listof webpages) a user has visited within a predefined time frame.

Optionally in particular embodiments, sparse inputs may be determinedbased on various observations, or characteristics, about a user (orcircumstance) or other feature inputs, such as reflecting an inferredpreference or tendency of the user or a categorized characteristic ofthe user/feature. This inference may be achieved by use of a RandomForest, or other classification or regression tool, prior identifyingdifferent relationships between pairs of inputs. For example, a featureinput may be submitted to a group of Boosted Decision Tree (BDT) Trees,and an each tree may provide an ID based on the leaf to which thefeature input corresponds. In this manner, the group of BDT Treesprovides a list of IDs, which together may define a sparse input.

In particular embodiments, each preprocessing module may includeEmbedding-Pooling (EP) blocks each processing a different input, dotproducts blocks that may define pairwise interactions of outputs fromthe EP blocks, and a concatenation block that may combine the outputs ofthe dot product blocks. In particular embodiments, each dense and sparseinput may consist of a list-of-IDs, and may optionally be submitted to adifferent EP block. The embedding portion of an EP block may converteach ID to a vector representation in an embedding space. That is, eachID in the list-of-IDs may be replaced by an embedding (e.g., afixed-length vector of randomly selected values whose weights need to belearned). For example, each ID may be represented by a 32-dimensionembedding (vector).

A pooling portion of an EP block may then combine the resultantembeddings into a single vector. Entries of corresponding dimensions ineach embedding may be combined (pooled or aggregated) using a predefinedpooling method (e.g., summing, averaging, max value, etc.) to define anEP output vector of fixed length that represents the original input.Since information may be lost during this aggregating process, thepooling process may be modified to preserve some relational informationbetween the list-of-IDs of an original input.

Relational information between the list-of-IDs of an original input maybe preserved using a ranking between the IDs in a list-of-IDs, where theranking may be defined based on a history of user interactions withspecific IDs. For example, if the IDs represent different webpages, thena ranking may be based on the frequency with which the user visited eachwebpage, or shared each webpage, or commented on each web-page, etc.This ranking may then be used to weigh the embedding (e.g., where higherfrequencies are assigned higher weights). Additionally, a functionutilizing user-based features may be defined to assign or modify weightsin the embedding.

Context information may also be used to modify embedding weights in whatmay be termed attention based pooling. For example, if a current IDwithin a list-of-IDs is determined to not be relevant to a currentobjective, then its embedding may be zeroed. Alternatively, if an ID isstrongly related to a current objective, then its embedding weight maybe increased. For example, if the “context” is defined by a specificuser ID, and prior behavior of this user has been found to be a goodindicator of future behavior in a current context, then the weight ofthe user ID's embedding may be increased.

It is to be understood that irrespective of the initialized weightsassigned to the embedding, the weights are likely to change during thetraining of the ML model, and thus may not reflect final weight values.

In particular embodiments, in order to identify multiple differentrelationships between pairs of inputs (both dense and sparse), eachinput in a pair of inputs may need to have multiple representations(e.g., the same input may be represented in multiple, different ways).For instance, a first relationship between a pair of inputs may berepresented by a corresponding pair of embeddings in an embedding space.Conceptually, the relative distance between the embeddings in this spacemay represent a degree of similarity/difference between the two withrespect to that first relationship. Similarly, a second relationshipbetween the same pair of inputs may be represented by a correspondingsecond pair of embeddings in a second embedding space. The relativedistance between the second pair of embeddings may again represent adegree of similarity/difference between the two inputs with respect tothe second relationship. Pair-wise relationship between the multiplerepresentations may then be determined, in what may termed a mixed MLapproach.

In this approach, multiple representations of a dense or sparse inputmay be achieved by submitting the same input (same list-of-IDs) tomultiple EP blocks to create multiple, alternate EP output vectorrepresentations of the same input. Because each EP block may assign adifferent, randomly selected embedding to each ID (in the list-of-IDs),the multiple, alternate EP output vector representations may be madedifferent from one another as the machine learning process learns of thedifferent relationships.

Also in this mixed ML approach, multiple relationships between differentpairs of inputs may be obtained by identifying relationships betweentheir respective, multiple representations. For example, the combinedrepresentation may be obtained by a dot product or cosine similarity,both of which provide a more explicit way to model pairwise interactionsbetween different features. A dot product may be determined betweenevery combination of each input's multiple representations (within aninput pair). The obtained dot products may then be concatenated togetherto define a mixture representation vector, which may be used as an inputwithin the SparseNN model. For example, if the ML model uses amulti-layer perception (MLP) approach, where outputs from one learninglayer are fed forward to one or more other learning layers, the mixturerepresentation vector may be input to a first learning layer. Additionalmixing of relationships between the mixture representation vector and athird (dense or sparse) input may be achieved by repeating the presentprocess in a second preprocessing module. This may be achieved byidentifying multiple representations of a current mixture representationvector and pairing these representations with multiple representationsof a third input.

The present method may be used to identify, or predict, commercialproducts (e.g. Ads) that a user may be interested in pursuing.

Hogwild and elastic averaging stochastic gradient descent (EASGD) arevariants of stochastic gradient descent (SGD), which may be used tooptimize a neural network using backpropagation. Under specificlimitations, Hogwild and EASGD may provide some benefits over a basicSGD approach, but typically, Hogwild and EASGD have contradictingoperational requirements. Nonetheless, in particular embodiments, amethod and system are herein provided to create a novel variant ofstochastic gradient descent that incorporates some benefits of Hogwildand EASGD in a multi-processor (e.g., multi-GPU or multi-CPU)infrastructure. In particular embodiments, another method and system isfurther provided to add an asynchronous SGD approach to the presentnovel variant of stochastic gradient descent.

In the following, GPU machines (computing machines that use themultiple, small processing units that may operate in parallel, e.g. eachdefining a separate operational thread, in a graphic processing unit(e.g., graphics card) to process data) may be used to handlepreprocessing work (e.g., process large amounts of data to reduce thedata size or place the data in a format suitable for further processing)in the training of a machine learning (ML) model (e.g., a neuralnetwork, NN, model). In some embodiments, GPU machine may herein beoptionally identified as “readers.”

Processed data from GPU machines may be streamed (transferred) to CPUmachines (machines that have one or more dedicated, multi-purposecentral processing units, CPUs) that further process the data (e.g.,according to an NN model) in a less parallel manner than in the GPUmachine to extract information, such as inferences between input dataterms (features). In some embodiments, CPU machines may be termed“readers” or “trainers”. In general, reader machines may handlepreprocessing work and stream their results to trainer machine.

One embodiment of the present disclosure is implemented in a two tierprocess. In the first tier, ML model data may be split across multipleGPUs. The ML model in the present disclosure may not be large enough touse all the CPUs in a typical GPU, therefore the model data allotted toeach GPU may be further divided into multiple (50-100) model threads(workers) to run in parallel. In specific embodiments, the workerswithin a GPU share a common memory without lock, which provides some ofthe speed benefits of Hogwild. However, whereas in Hogwild the sharedmemory would be the master memory, in the present case, the sharedmemory may be a local parameter memory of a GPU. That is, the sharedmemory in the GPU is not a master parameter memory for all workers inall GPUs, but may instead be a local memory that holds only localparameters of processing cores internal to that specific GPU.

The second tier may address the management of the multiple GPUs, and themanagement of a master parameter memory that is routinely updated tomaintain a copy of the local parameter memories in multiple GPUs.Optionally, one of the multiple GPUs may be designated to hold themaster parameter memory. At predetermined times, each of the multipleGPUs, in turn, synchronizes its local parameter memory with the masterparameter memory. During synchronization with a given GPU, the masterparameter memory is locked from access from any other GPU. In thismanner, the master memory is updated as a moving average over the localparameters computed from the multiple GPUs.

In order to mitigate delays due to cross-GPU communications, the firsttier (within each GPU) may be further augmented with a small group ofindependent communication workers (e.g., 4 to 8) dedicated tosynchronizing a GPU's local parameter memory with the master parametermemory. In this manner, the GPU's other (50-100) model threads are notinterrupted by the synchronization of their shared memory with themaster parameter memory.

In some embodiments, an asynchronous approach may be applied to some ofthe preprocessing work described above. Firstly, parameters may besharded (divided into sub-sets) across multiple parameter servers, whichcommunicate with “trainer machines”. In addition to holding a parametershard, the parameter servers may further provide embeddings for inputfeatures (dense or sparse vector inputs), and if the resulting, activeembedding is determined to be larger than a predefined value, theparameter server may further reduce the size of the data by applyingpooling across embeddings. If the embedding is determined to be smallerthan a predefined value, the parameter server may send the activeembedding across a network to a trainer machine, where it may be pooledinto a smaller size. The trainer machine may then combine pairs ofpooled features by dot product, or other combining method.Alternatively, if the data size after pooling at the parameter server iswithin a predefined range, the parameter server may combine the data bydot-product and send the result to a trainer machine.

The trainer machines may use local workers to process data and computelocal gradients on a mini-batch (or batch). The workers may then send(push) gradient updates to the parameter servers, which may process theupdates asynchronously. In particular embodiments, the trainers maystore parameter data in local memory without lock, and periodically(e.g., after each pass/iteration, or after a predefined number ofpasses/iterations) push their local gradient changes (parameter updates)to the appropriate parameter servers (as determined by the shard ofparameters they hold). That is, each trainer has access to all parameterservers, and addresses a parameter server in accordance with theparameter memory shard that needs updating. Thus, the trainers maymaintain a local parameter memory and the parameters servers maymaintain the master parameter memory (as a composite of all the shards)averaged across multiple trainers. Additionally, the trainers mayfurther dedicate a small, independent group of workers (e.g., 4 to 8) tosynchronizing their local parameter memory with the master parametermemory (shards) in the parameter servers. In particular embodiments,trainers may be implemented in CPU-based or GPU-based machines.

In particular embodiments, a method and system is provided for splittingthe execution (e.g. computer processing) of an already trained machinelearning ML model (e.g. a Sparse NN, ML model) between a local machineand a remote machine, over a network. The local machine, which may be alocal ranking machine, may be characterized by a computer architecturethat emphasizes computational power over memory availability. The remotemachine, which may be a back-end service such as remote predictor, maybe characterized by a computer architecture that emphasizes availabilityof large memory banks over computational power. In addition todifferences in computational resources, the local machine and the remotemachine may have access to different data sets (e.g., the local machinemay have access user features, e.g., user sparse of dense inputs).Particular embodiments may define (or access) a (nodal) graphrepresentation of the ML model that identifies data processing, memoryrequirements, and optionally the number of inputs of each graph node,and may split the graph into multiple graph-segments that may beprocessed independent of each other. This segmentation allows eachgraph-segment to be distributed for processing to the machine with theappropriate resources (e.g., computational resource or data resource).For example, compute-intensive graph-segments may be designated forprocessing within the local machine and memory-intensive graph-segmentsmay be designate for processing on the remote machine, while minimizingnetwork traffic. Output results processed graph-segments may be sent toa merge processing block within the local machine, where they may bemerged with outputs from other processed graph-segments according to the(nodal) graph representation of the ML model, and a final result maythereby be determined.

Before discussing the present embodiments in detail, it may bebeneficial to first provide some background information regarding neuralnetworks in general. A neural network, or neural net, is a (nodal)network of interconnected neurons, where each neuron represents a nodein the network. Groups of neurons may be arranged in layers, with theoutputs of one layer feeding forward to a next layer in a multilayerperception (MLP) arrangement. MLP may be understood to be a feedforwardneural network model that maps a set of input data onto a set of outputdata.

FIG. 1 illustrates an example of a multilayer perception (MLP) neuralnetwork. Its structure may include multiple hidden (e.g. internal)layers HL1 to HLn that map an input layer InL (that receives a set ofinputs (or vector input) in_1 to in_3) to an output layer OutL thatproduces a set of outputs (or vector output), e.g., out_1 and out_2.Each layer may have any given number of nodes, which are hereinillustratively shown as circles within each layer. In the presentexample, the first hidden layer HL1 has two nodes, while hidden layersHL1, HL3 and HLn each have three nodes. Generally, the deeper the MLP(e.g. the greater the number of hidden layers in the MLP), the greaterits capacity to learn. The input layer InL receives a vector input(illustratively shown as a three-dimensional vector consisting of in_1,in_2 and in_3), and may apply the received vector input to the firsthidden layer HL1 in the sequence of hidden layers. An output layer OutLreceives the output from the last hidden layer, e.g. HLn, in themultilayer model, processes its inputs, and produces a vector outputresult (illustratively shown as a two-dimensional vector consisting ofout_1 and out_2).

Typically, each neuron (or node) produces a single output that is fedforward to neurons in the layer immediately following it. But eachneuron in a hidden layer may receive multiple inputs, either from theinput layer or from the outputs of neurons in an immediately precedinghidden layer. In general, each node may apply a function to its inputsto produce an output for that node. Nodes in hidden layers (e.g.,learning layers) may apply the same function to their respectiveinput(s) to produce their respective output(s), as described below. Somenodes, however, such as the nodes in the input layer InL receive onlyone input and may be passive, meaning that they simply relay the valuesof their single input to their output(s), e.g., they provide a copy oftheir input to their output(s), as illustratively shown by dotted arrowswithin the nodes of input layer InL.

For illustration purposes, FIG. 2 shows a simplified neural networkconsisting of an input layer InL′, a hidden layer HL1′, and an outputlayer OutL′. Input layer InL′ is shown having two input nodes i1 and i2that respectively receive inputs Input_1 and Input_2 (e.g. the inputnodes of layer InL′ receive an input vector of two dimensions). Theinput layer InL′ feeds forward to one hidden layer HL1′ having two nodesh1 and h2, which in turn feeds forward to an output layer OutL′ of twonodes o1 and o2. Interconnections, or links, between neurons(illustrative shown as solid arrows) have weights w1 to w8. Typicallyexcept for the input layer, a node (neuron) may receive as input theoutputs of nodes in its immediately preceding layer. Each node maycalculate its output by multiplying each of its inputs by each input'scorresponding interconnection weight, summing the products of it inputs,adding (or multiplying by) a constant defined by another weight or biasthat may associated with that particular node (e.g., node weights w9,w10, w11, w12 respectively corresponding to nodes h1, h2, o1, and o2),and then applying a non-linear function or logarithmic function to theresult. The non-linear function may be termed an activation function ortransfer function. Multiple activation functions are known the art, andselection of a specific activation function is not critical to thepresent discussion. It is noted, however, that operation of the MLmodel, or behavior of the neural net, is dependent upon weight values,which may be learned so that the neural network provides a desiredoutput for a given input.

The neural net learns (e.g., is trained to determine) appropriate weightvalues to achieve a desired output for a given input during a training,or learning, stage. Before the neural net is trained, the weights may beindividually assigned an initial (e.g., random and optionally non-zero)value. Various methods of assigning initial weights are known in theart. The weights are then trained (optimized) so that for a giventraining vector input, the neural network produces an output close to adesired (predetermined) training vector output. For example, the weightsmay be incrementally adjusted in thousands of iterative cycles by atechnique termed back-propagation. In each cycle of back-propagation, atraining input (e.g., vector input) is fed forward through the neuralnetwork to determine its actual output (e.g., vector output). An errorfor each output neuron, or output node, is then calculated based on theactual neuron output and a target training output for that neuron. Onethen propagates back through the neural network (in a direction from theoutput layer back to the input layer) updating the weights based on howmuch effect each weight has on the overall error so that the output ofthe neural network moves closer to the desired training output. Thiscycle is then repeated until the actual output of the neural network iswithin an acceptable error range of the desired training output.

Thus, construction of a neural network model may include a learning (ortraining) stage and a classification (or operational) stage. In thelearning stage, the neural network may be trained for a specific purposeand may be provided with a set of training examples, including traininginputs and training (sample) outputs, and optionally including a set ofvalidation examples to test the progress of the training. During thislearning process, various weights associated with nodes andnode-interconnections in the neural network are incrementally adjustedin order to reduce an error between an actual output of the neuralnetwork and the desired training output. In this manner, a multi-layerfeed-forward neural network (such as discussed above) may be madecapable of approximating any measurable function to any desired degreeof accuracy. The result of the learning stage is a (neural network,machine learning) model that has been learned (e.g., trained). In theoperational stage, a set test inputs (or live inputs) may be submittedto the learned (trained) ML model, which may apply what it has learnedto produce an output prediction based on the test inputs.

The present disclosure provides multiple architectures for, and methodsof training a, (neural network, NN) machine learning (ML) model that mayprovide deeply personalized predictions for users when used in anoperational (or classification) stage. That is, the present disclosuremay provide a ranking and recommendation (neural network) framework todeliver a more personalized experience for various service products,such as Ads Ranking, Feeds Ranking, Networking Services that prioritizeitems for sharing among users, Explore Services that identify items(e.g. pictures, videos, and articles) similar to items a user haspreviously liked, etc. This may be achieved by the present modelarchitectures, which may include a nested architecture and a mixedarchitecture. The nested architecture may consider higher orderrelationships between inputs, and the mixed architecture may introduce amixture of different representations of the same input. Additionally,model quality may be improved by various modifications to anembedding-pooling (EP) process that may strengthen semanticrelationships between features/inputs.

For ease of illustration, some features of the present disclosure may bedisclosed within the context of practical example implementations. Dueto real-world hardware limitations, neural networks may have practicalsize limits. For example, in particular embodiments, the present MLmodels may achieve sizes not well-suited to these practical limits, suchas 10 GB, which may complicate their hardware implementation. Therefore,in particular embodiments, specialized hardware implementations that maydistribute the present ML model among local and remote machines on anetwork using specific optimization techniques may be provided.

For example purposes, in particular embodiments, the present ML modelarchitectures may be implemented within a sparse neural network (SparseNN) environment to facilitate learning from multiple forms of features(e.g., dense feature vectors and sparse feature vectors) jointly inend-to-end (e.g., multilayer perception) neural nets. In embodiments,dense feature vectors may be use to represent dense (vector) inputs, andsparse feature vectors may be used to represent sparse (vector) inputs.

As explained above, a dense feature vector (e.g., dense input) may berepresented by a mostly-populated vector (e.g. a vector having mostlynon-zero entries/cells). In the present example, a dense input may be adense feature vector that may consist of determinable descriptors commonto (or determinable for) most users (or circumstances, depending upon aspecific application) and often gleaned from multiple sources. Forexamples, dense features may include a user's gender, country-of-origin,time-of-day, local Wi-Fi status, user-educational-background, etc. It isnoted that some dense features may be obtained by user-provided input,while others may be collected from user-related demographic orgeographic information, user-device status information, user networkactivity, or other observable user-related sources. A dense input may bethought of as a collection of multiple, definitely determinabledescriptors, where each descriptor may be given a numeric value. Becausedense inputs may be comprised of many descriptor types (e.g.,signal/value sources) that together may characterized (e.g., describe) auser (or circumstance), a dense input may be a large, dense vector withone or more cells/dimensions/entries in the dense vector beingdesignated to each descriptor type.

A sparse input may reflect more semantic information related to aparticular task objective. The sparse input may be defined by a sparsefeature vector that reflects selections within a larger list(s) ofoptions (lists may further be divided/grouped into differentcategories). Additionally, sparse inputs may not necessarily be directlydescriptive of a user (or circumstance), but may instead provideauxiliary information indirectly related to the user (or circumstance).For example, webpages may have a list of associated advertisements (e.g.ads posted by a webpage provider). While one sparse input may reflectthe individual webpages visited by a user, another (related) sparseinput may provide more semantic information and reflect the ads(selected from among a larger list of ads) that are associated with(e.g. available to) the individually visited webpages. Training data mayindicate which associated ads a training user selected (clicked on), andthe neural network model may learn to predict what is the probability ofa test user (that is similar to the training user, such as determinedfrom the training user's user-descriptive dense input and the testuser's corresponding dense input) selecting the same (or asimilar/related) ad.

A sparse input may include a list of select IDs, where the sparseinput's semantic information may be embodied by its list of IDs. As anexample, a sparse (feature) input may be constructed from selections ofentries from a dense (feature) vector. This may be the case when thelist of IDs that comprises the sparse input identifies individualselections from a larger list of options (such as provided by the densevector). In this case, the sparse (vector) input may be used to captureindividual selections from the features/entries in the dense vector.That is, within a sparse vector, individual selections may berepresented by singular, or group, entries. For example, a sparse inputmay be a list of webpage IDs indicating which webpages (from within alarger category list of webpages) a user has visited within a predefinedtime frame, or has commented on, or liked, or has otherwise interactedwith. In this case, the sparse (vector) input may have a separate cell(or group of cells) for each possible selection, and it may be populatedby assigning a zero value to each not-selected option and assigning anon-zero value (e.g. numeral “1”) to each selected option. As a result,a sparse vector may be characterized by having mostly zero entries, anda few non-zero entries. Consequently, a sparse vector may be representedas a series of indexes pointing to select cell positions (those havingnon-zero values) in the larger list along with each index'scorresponding non-zero value for that position, with the understandingthat all other positions not having an index have a default zero value.

In addition to providing information regarding selections from a largerlist of options, sparse inputs may provide classification information.That is, sparse inputs may provide inferred information based on variousobservations, or characteristics, about a user (or circumstance) orbased on other feature input selections. For example, a sparse input mayindicate an inferred preference or tendency associated with auser/feature, or a classification (e.g., categorization) characteristicof the user/feature. This inference may be achieved by use of a RandomForest, or other classification or regression tool. It is to beunderstood that the classification or regression tool may be trainedprior to training a neural network (ML model) in accord with the presentdisclosure. The classification or regression tool may be used to defineentries (cells) of a sparse input. For example, a feature input may besubmitted to a group of Boosted Decision Tree (BDT) trees and allowed topropagate (be distributed) through each tree in the group until reachinga leaf in each respective tree. Each tree may provide an ID (cell entryfor the sparse input) based on the leaf to which the feature inputpropagated. In this manner, the group of BDT Trees may provide a list ofIDs, which together may define a sparse input. As an example, a featureinput submitted to the BDT trees may refer to a specific webpage, or agegroup, user-demographic, etc., or to a combination of such features. Theinferred meaning of the sparse input provided by the BDT tree would bedependent upon what categorization (e.g., classifications) the BDT treewas trained to discern.

Typically, because of their many zero-entry cells, sparse vectors maynot well-suited for direct input to a neural network. To place them in aform better suited for a neural network, sparse inputs may first beconverted to low-dimensional (and dense) representations (e.g. vectorshaving fewer, but mostly non-zero, entries/cells). An example of thistype of low-dimensional conversion by use of embedding matrices isprovided below.

FIG. 3 illustrates a method of combining one or more dense input and oneor more sparse input in a neural network. In the present example,preprocessing blocks PreD1, PreS1, and PreS2 may configure theirrespective inputs into formats better suited for a neural network. Inthe present example, preprocessing block PreD1 may be passive, meaningthat it may convey its received input to its output withoutmodification. For example, input “Dense” may be a dense (vector) inputthat is already in proper format for a neural network (e.g., it may havemostly non-zero entries), and preprocessing block PreD1 may recondition(e.g., boost/sharpen signal shapes) of input Dense to define (asintermediate output of block PreD1) input InD1 to combining (orconcatenation) block Cnct_1.

As is explained above, however, sparse vectors, such as inputs Sparse-1and Sparse-2, may have a large proportion of zero entries, and thus maynot be optimally configured for a neural network. Preprocessing blocksPreS1 and PreS2 may convert their respective sparse inputs, “Sparse-1”and “Sparse-2,” to corresponding low-dimensional vector representations,InS1 and InS2, (e.g., low dimensional dense vectors, e.g., vectorshaving a few (e.g., 32) mostly non-zero entries/cells). Preprocessingblocks PreS1 and PreS2 may apply the same preprocessing to theirrespective sparse vector inputs, Sparse-1 and Sparse-2, or preprocessingblock PreS1 may preprocess Sparse-1 differently than block PreS2preprocesses Sparse-2. Optionally, preprocessing blocks PreS1 and PreS2may both implement a low-dimensional conversion/transformation, such asby use of an embedding mechanism/process to define latent vectorrepresentations, as described below.

In the present example, intermediate signal InD1 may be directlyconcatenate with intermediate signal InS1 and InS2, the low-dimensionalrepresentations of corresponding sparse inputs Sparse-1 and Sparse-2.For example, Concatenation block Cnct_1 may directly append its inputsInS1 and InS2 to the end of its input InD1. The resultant concatenatedinput InCnct may then be applied to an MLP neural network (or other MLmodel) in a manner similar that described above. That is, input InCnctmay be applied to a first input layer InL_1, which in turn may relay itto a first hidden layer HL_1 in a series of hidden layers of an MLPneural network.

In particular embodiments, preprocessing blocks PreS1 and PreS2 mayconvert their respective sparse inputs, Sparse-1 and Sparse-2, tocorresponding low-dimensional representations (e.g. latent vectorrepresentations), InS1 and InS2, by applying an embedding process (orgraph embedding), which may use a corresponding embedding matrix foreach category of entity or item that is represented by sparse inputs.That is, a sparse input, Sparse-1 or Sparse-2, may include a list ofIDs, where each ID may identify a non-zero entry in sparse input. Inpreprocessing, each ID in the sparse vector may be replaced by (orotherwise converted to) an embedding (e.g., a low-dimensional feature(dense) vector) that conveys a semantic meaning to that ID.Determination of the conveyed semantic meaning, and thus the embedding,is dependent upon how the neural network is trained. That is, theembedding matrices may be comprised of feature weights (e.g.parameters), and the embedding matrices and other parameters (e.g., linkweights and node weights) of the (MLP) neural network may be learnedjointly by back-propagation, or other suitable neural network trainingprocess.

In general, graph embedding aims to embed a graph into a Euclidean spaceso that each node in the graph has a coordinate. There are various graphembedding algorithms known in the art, and typically they differ in whatproperties one wishes to preserved during the embedding. For example,Isomap is a nonlinear dimensionality reduction method that embeds thegraph that most faithfully preserves the shortest distance between anytwo nodes in the graph, while Laplacian Eigenmaps is a method thatpreserves proximity relations, mapping nearby input nodes to nearbyoutputs, and Maximum Variance Unfolding aims to map high dimensionaldata points to low dimensional embeddings while preserving certainproperties about the manifold during the embedding. Irrespective of thegraph embedding method, the obtained embeddings may be used in a widerange of applications such as visualization, classification or heuristicsearches. That is, embedding an entity results in a vectorrepresentation of that entity within the defined vector space, whichpermits semantic or heuristic meaning to be extracted from differententities based on their embeddings (vector relationships) within thedefined vector space.

FIG. 4 illustrates an example embedding and pooling technique.Optionally, preprocessing blocks PreS1 and PreS2 may each implement theembedding and pooling technique of FIG. 4 to convert their respectivesparse input, Sparse-1 or Sparse-2, to corresponding low-dimensionalrepresentation, InS1 or InS2. For ease of discussion, the EP block ofFIG. 4 is shown as being implemented by preprocessing block PreS1, butit is to be understood that the same EP block may likewise beimplemented by preprocessing block PreS2 of FIG. 3.

In the present example, the input to PreS1 is illustratively shownreceiving a sparse (vector) input (e.g. Sparse-1). In particularembodiments, a preprocessing block PreS1 or PreS2 may alternatelyreceive a dense vector. As is explained above, sparse inputs may be usedto represent category information related to a user, or circumstance,such as visited webpages, frequency of webpage visits, clickedadvertisements, submitted preferences, etc. Thus the present approachprovides for category embedding, and thereby can provide insight intocategory similarities. That is, with embedding, similar categories maybe mapped to nearby regions in the resultant embedding space. The modellearns a numerical embedding (e.g., parameter weights) for each categoryof a categorical feature, based on all categories in the embeddingspace, which permits visualization of relationships between categoriesand thus permits extraction of similarity-knowledge between categoriesbased on geographic relationships within the embedding space.

As is also explained above, a sparse vector may include a series ofindexes pointing to selections from a larger list, and each index'sassigned value. In the present case, input Sparse-1 (relabeled asgeneric indicator “X” within preprocessing block PreS1) may include alist of IDs, as described above, which are illustratively identified asa series of “k” IDs: S₁, S₂, . . . , S_(k). In the present case, each IDentry may include a corresponding pointer index (pt1, pt2, . . . , ptk)pointing to a selection option, or category, within an embedding matrixEM. The embedding matrix EM may assign a vector representation (V₁, V₂,. . . , V_(k)) of fixed dimension (e.g., 32 cells/dimensions in eachvector representation). Consequently, embedding matrix EM may have aheight equal to the embedding dimension (e.g. dimension size of assignedvector representations, e.g., 32 cells/dimensions long) and a widthequal to the number of possible object/feature selections (e.g. themaximum number of available IDs to select from). After embedding, theseries of IDs (S₁, S₂, . . . , S_(k)) of input “X” may each beindividually replaced by a series embedding vector representations (V₁,V₂, . . . , V_(k)), such that after embedding, X may be defined asX={V₁, V₂, . . . , V_(k)}.

At this point, the embeddings (V₁, V₂, . . . , V_(k)) of the inputIDs/features (S₁, S₂, . . . , S_(k)) may be submitted to a poolingstage, which may down-sample the multiple embeddings into a singlerepresentative vector. That is, the pooling stage may convert the seriesof embedding vector representations (V₁, V₂, . . . , V_(k)) into asingle pooled vector, Vpl, having the same dimension as the embeddingvector representations. In this manner, the pooling stage creates asingle low-dimensional vector (e.g., Vpl) of the entire, original inputSparse-1. In effect, pooling reduces the amount of data flowing througha neural network (ML model), and may thereby decrease the computationalcost of the neural network. Basically, pooling may be a way to define acompact representation of the input (e.g., Sparse-1) to the EP block byaggregating the embeddings (e.g., the embedding vector representations)of the input. It is noted that the input may be any dimension, e.g.,Sparse-1 may have any number of IDs in its lists of ID's.

The aggregating of the different embeddings may be achieved by applyingan element-wise (dimension-wise) operation on corresponding elements ofeach embedding, as indicated by dotted lines in FIG. 4, to define thepooled vector Vpl. For ease of discussion, the present example mayassume that input Sparse-1 has only three IDs in its list of IDs, e.g.it is assumed that “k” is 3 in FIG. 4. That is, the element-wise (e.g.,bi-gram) pooling technique may be applied to top cell “a” of embeddingV₁, to top cell “b” of embedding V₂, and to top cell “c” of embeddingV_(k) to define the top cell “r” of pooled vector Vpl. The same poolingtechnique may be applied element-wise on the next cell in the embeddingvector representations, and so on until all cells of the embeddingvector representations have been processed, and pooled vector Vpl fullydefined. Multiple linear pooling techniques are known in the art, andFIG. 4 illustrates three optional techniques. That is, typical linearpooling techniques (operations) may include summation pooling(element-wise summation of the embeddings), average pooling (theelement-wise averaging of the embeddings), or max pooling (taking thegreatest element-wise value in the embeddings). Other pooling techniquesmay include geometric pooling and multiplicative pooling, but thesepooling techniques may require additional computational resources.

Although pooling may provide a computational advantage for processing alarge number of embeddings, some information may be lost during theaggregation process. The present disclosure therefore provides optionalimproved pooling methods that may reduce the loss of information. Onesuch method is attention based pooling. In this case, the aggregationprocess may be improved by paying more attention to (e.g., weighing moreheavily) related information based on a current “context.” In thepresent case, sparse inputs may provide contextual information, some ofwhich may be emphasized. For example, larger weights may be placed onmore important ID in the sparse input (e.g., webpages that are visitedmore often than other webpages) in the case of linear pooling. Moreuseful information may thereby be preserved in the final compactrepresentation of each entity. As is explained above, the embeddings maybe a series of weights, and so individual embeddings that correspond tomore important IDs may be assigned higher weights (or the originalembedding weights may be increased by an additive or multiplicativeweight).

Thus, the “context” of the sparse input may be important in theattention based pooling. If a sparse ID is not informative in any“context”, the present sparse neural network model (SparseNN) may, forexample, simply learn zero embedding for it (e.g., learn zero (value)weights for its embedding), but if a sparse ID does inform a context(e.g., provide additional contextual, or implicit, information relatedto the context), then the interaction between the “context” and SparseIDs may be important. For example, if the “context” corresponds to auser, and it is desired to pay more attention to (emphasize) a certainwebpage_id when modeling this user because this user engaged (e.g.,liked, commented on, visited, etc.) more than a threshold number oftimes with this webpage_id, then a bigger weight may be assigned to theembedding of this webpage_id irrespective of the webpage_id'scontents/characteristics. Thus, prior to embedding, the list of IDs in asparse input may be sorted by perceived contextual information (e.g.,popularity or interest to the user), and the embedding may be emphasized(adjusted) based on the position of each ID in the sorted list of IDs.For example, the order of a coefficient_page_id feature (e.g. a webpageID) may be decided based on a coefficient score, which may be based onmore detailed user's engagement history with a webpage. Thus, a basicattention based pooling method may be termed “position-based weightedpooling”, and it may use the order/position of a sparse ID (e.g. an IDin a list of IDs of a sparse input) as conveying interaction informationbetween a given “context” and the sparse ID. This method may beeffective in ads click-thru-rate (Ads CTR) mobile feed dataapplications.

As is described below, the present disclosure further provides forembedding of dense vector inputs along with sparse vector inputs. Thatis, dense inputs may also be submitted to an EP block, such asillustrated in FIG. 4, or other suitable EP architecture. For a densevector, linear pooling (element-wise pooling, such as described above)may be used so that the EP block may be similar to a linearfully-connected layer. Embedding dense inputs along with sparse inputsin the construction of the embedding space may provide for morerelational information between the two types of inputs.

FIG. 5 illustrates an embodiment with combined embedding and pooling ofboth dense input(s) and sparse input(s). Elements in FIG. 5 similar tothose of FIG. 3 have similar reference characters and are describedabove. Like before, sparse (vector) inputs Sparse-1 and Sparse-2 may besubmitted to preprocessing blocks PreS1 and PreS2, which may applyembedding and pooling to create intermediate outputs Insl and Ins2,respectfully. As is explained above, both preprocessing blocks PreS1 andPreS2 may use the same architecture, such as illustrated in FIG. 4, forexample. Like in the case of FIG. 3, the dense (vector) input “Dense”may be applied to a passive preprocessing block PreD1, which may conveyinput “Dense” to its intermediate output InDl. In the embodiment of FIG.5, however, the dense input “Dense” may also be applied to a secondpreprocessing block PreD2 that may convert the original dense input to alower-dimensional (dense) representation. In the present example,preprocessing block PreD2 may transform input “Dense” to intermediateoutput InD2 of equal dimension as the intermediate outputs ofpreprocessing blocks PreS1 and PreS2. In particular embodiments,preprocessing block PreD2 may apply an embedding and pooling processsimilar that of preprocessing blocks PreS1 and PreS2 to defineintermediate output InD2. Alternatively, preprocessing block may use atransformation method other than embedding, to define thelower-dimensional representation of input “Dense,” but may still use apooling process to define the final, single vector InD2 of equaldimension as InS1 and InS2.

Unlike the embodiment of FIG. 3, where the low-dimensionalrepresentations (e.g., pooled latent vectors) produced by thepreprocessing blocks are directly concatenated to the original dense(vector) input (e.g., InD1), the present embodiment may model pairwiseinteractions between respective latent vectors, InD2, InS1, and InS2.Combined representation of latent vectors may be obtained by dot productor cosine similarity, both of which may provide an explicit way to modelpairwise interactions between different features. In the example of FIG.5, pairwise interactions are modeled, as an example, by obtaining thedot product of every unique pairwise combination of low-dimensionalrepresentations InD2, InS1 and InS2, as indicated by dot product blocksD1, D2, and D3. The dot products results may then be concatenate to theoriginal dense input, InD1, by concatenation block Cnct_1, and fedforward into the subsequent ML model layers (e.g., InL_1 and Hl_l of anMLP neural network), as explained above. Both the embeddings and weightsmay be jointly learned through back-propagation as explained above, orby another known learning (training) method.

In this manner, latent (or semantic) meanings of the sparse inputs thatare more closely related to the dense input(s) may be obtained. That is,dense features may provide stand-alone characterizations of a user(e.g., is the user online or offline), and the pairwise modeling ofdense feature with the sparse features my more closely relate the sparsefeatures to those stand-alone characterizations. For example, a sparsefeature may indicate an ad that a user may be likely to select, but if adense feature indicates that the user is offline, then the combinationof the two vectors may indicate that the user is less likely to selectthe ad when the user is offline than when the user is online. Inessence, the dot products may provide a measure of synergy betweenfeatures (dense or sparse).

Although the dot-product may be an economic way to capture bi-graminteraction (interactions between two adjacent (e.g. corresponding)elements in two feature vectors), the dot-product may lack the abilityto model higher-order interactions (consideration of relationships amongfour or more variables). For example, FIG. 5 shows three inputs (Dense,Sparse-1 and Sparse-2), but the number of inputs may be in the order ofhundreds, thousands, or millions, which may pose practical problems. Ifadditional inputs were incorporated to the embodiment of FIG. 5 (e.g.,if additional preprocessing blocks were arranged laterally in FIG. 5),the number of dot product combinations required to consider all uniqueinteraction pairs between inputs may grow in proportion to the square ofthe number of inputs. That is, the number of dot products needed for agiven number of n inputs may be (n²−n)/2, which may place a practicallimit on the embodiment of FIG. 5.

FIG. 6 illustrates a nesting architecture that may facilitate modelingof higher-order interactions between features. As mentioned above, theembodiments of the present disclosure include a nested architecture anda mixed architecture, both of which may be modularized and combined.Elements in FIG. 6 similar to those of FIG. 5 have similar referencecharacters and are described above. The present nested architecturemodel may infuse additional relationship information among multipleinputs (e.g. categories, sparse inputs, dense inputs, etc.), and providefor higher order relationships between a multitude of inputs.

Unlike the ML model of FIG. 3, where low-dimensional representations ofsparse inputs may be directly concatenated to a dense input to define acombined vector, the present embodiment provides for more explicit(direct) ways to model pairwise interactions between different features.That is, the present ML model of FIG. 6 provides for combinedrepresentations of multiple inputs. Again, the dense input “Dense” maybe submitted to a preprocessing block PreD2 (EP block) that may be thesame, or similar, as the preprocessing blocks, PreS1 and PreS2, to whichsparse input(s) (e.g., Spasrse-1 and Sparse-2) are submitted, and acombined representation may be obtained between every combination of thedense input and one, two, or more sparse inputs. In the presentembodiment the combined representations may be obtained by use of thedot product, but other methods of modeling pairwise interactions betweendifferent features, such as cosine similarity, may be used.

Like in the ML model of FIG. 5, the present approach of FIG. 6 providesexplicit modeling of pairwise interactions between different features,and may be used with MLP ML models that may be limited to a small numberof neural network (hidden) layers (e.g. 128, 64, 32, or fewer layers).For example, if explicit modeling of pairwise interactions were omitted,and the inputs were simply concatenated as in FIG. 3, then the MLP MLmodel may require a larger number of neural network (hidden) layers(e.g. 512, or more layers) to learn the embeddings and MLP weights(parameters or gradients). Thus, the present architecture(s) may improvethe MLP's capacity to learn using fewer neural network layers. As itwould be understood, a smaller MLP may be faster to train and mayrequire lower computer processing resources. Thus the present model(s)may provide a direct processing advantage over other methods. This maybe of particularly importance in some time-critical applications, suchas ads click-through-rate (CTR) prediction tasks, which may typicallyhave low latency requirements.

The nesting architecture of FIG. 6 provides for multiple preprocessingmodules, M_1 and M_2, which may include generating low-dimensionalrepresentations of input vectors, pairwise interaction modeling, andcombining of interim outputs. Although only two preprocessing modules,M_1 and M_2, are illustrated, it is to be understood that three or morepreprocessing modules may be implemented, with each preprocessing modulehaving three or more inputs. In the example of FIG. 6, bothpreprocessing modules M_1 and M_2 each are shown to receive the samesparse inputs Sparse-1 and Sparse-2. In the approach of FIG. 6, lowerpreprocessing modules (e.g., M1) may be thought to capture bi-graminteractions, and the higher preprocessing modules (e.g., M2) may bethought to learn higher order interactions based upon them. This mayprovide improved predictions. Optionally, different EP blocks indifferent preprocessing modules may assign a different embedding to thesame inputs. Additionally, different preprocessing modules may receiveat least one different input. Although the general structure of eachpreprocessing module, M_1 and M_2, may be similar, the referencecharacters identifying internal elements of preprocessing module M_2 aredifferentiated from those of preprocessing module M_1 by the addition ofan apostrophe to indicate that they may not necessarily be implementedthe same. For example, if preprocessing block PreS1′ (of M_2) assigns adifferent embedding to its input, Sparse-1, than preprocessing blockPreS1 (of M_1) assigns to its input, Sparse-1, then the low-levelrepresentation intermediate output InS1′ of block PreS1′ (within M_2)may be different than the low-level representation output InS1 of blockPreS1 (within M_1).

In the example of FIG. 6, the output of preprocessing module (e.g., M_1)goes through block 11 prior to entering a next preprocessing module(e.g., M_2) in sequence. Block 11 may be a passive layer and convey theoutput of concatenation block Cnct_1 of preprocessing module M_1 topreprocessing blocks PreD1′ and PreD2′ of preprocessing module M_2.Alternatively, block 11 may implement a hidden layer, such as blockHL_1.

FIG. 7 illustrates an example method for a nested architecture ML model.In step S10, a computing device (e.g., a Facebook server) may access aneural network model having a multiple preprocessing modules, includinga first module (e.g., M_1) and a second module (e.g., M_2). Each of thepreprocessing modules may have a respective first input (e.g., a denseinput) and at least one respective second input (e.g. a sparse inputsuch as Sparse-1 and/or Sparse-2). In step S12, each module (e.g., M_1)generates a first latent vector representation (e.g., embedding-poolingintermediate output InD2) of its respective first input (e.g., inputDense), and generates a second latent vector representation (e.g., InS1or InS2) of its respective second input (Sparse-1 or Sparse-2,respectively). In step S14, each module (e.g., M_1) models a pairwiseinteraction (e.g., by dot product block D2) between its respective firstlatent vector representation (e.g., Ind2) and its respective secondlatent vector representation (e.g., InS1), and combine (e.g., byconcatenation block Cnct_1) its modeled pairwise interaction (e.g.,output from D2) with its respective first input (e.g., input Dense) todefine a respective intermediate output (e.g., output from concatenationblock Cnct). In step S16, the intermediate output (e.g., output fromconcatenation block Cnct) of the first module (e.g., M_1) is fed forwardto the first input (e.g., input of blocks PreD1′ and PreD2′) of thesecond module (e.g., M_2).

Particular embodiments may repeat one or more steps of the method ofFIG. 7, where appropriate. Although this disclosure describes andillustrates particular steps of the method of FIG. 7 as occurring in aparticular order, this disclosure contemplates any suitable steps of themethod of FIG. 7 occurring in any suitable order. Moreover, althoughthis disclosure describes and illustrates an example method for a nestedarchitecture ML model including the particular steps of the method ofFIG. 7, this disclosure contemplates any suitable method for a nestedarchitecture ML model including any suitable steps, which may includeall, some, or none of the steps of the method of FIG. 7, whereappropriate. Furthermore, although this disclosure describes andillustrates particular components, devices, or systems carrying outparticular steps of the method of FIG. 7, this disclosure contemplatesany suitable combination of any suitable components, devices, or systemscarrying out any suitable steps of the method of FIG. 7.

In the architecture of FIG. 5, a single embedding (or latent vector,which has inherent data or inferable data) may be learned for eachsparse feature, and the dense feature(s) may be projected into the samevector space (embedding space) as the sparse inputs before doingpairwise interactions (e.g. dot-products). It has been found, however,that it may be beneficial to provide multiple embeddings (featurerepresentations) for some features (sparse or dense input(s)). That is,some features may convey more than one contextual meaning, and theirdifferent meanings may need to be evaluated (learned) within the contextof their interactions with other features. As an analogy, one mayconsider a word that has multiple meanings depending upon a context inwhich it is used. For example, the word “bank” may mean a financialinstitution in a first context, or a rising of ground bordering a bodyof water in a second context, or a land formation having a steep slopein a third context, etc. In order to capture different contextualmeanings of a feature within the context of its interactions with otherfeatures (which themselves may have different contextual meanings), ithas been found that interactions between different pairs of features mayrequire different embeddings (different underlining featurerepresentations), which put emphasis on different aspects of a signal(or signal source from which the embedding is defined). Herein, thislearning of a mixture of different embeddings of input features may betermed a mixed architecture (neural network).

FIG. 8 illustrates an example mixed architecture neural network. In thepresent example, the same feature input (e.g. Feature-1 or Feature-2),which may be a sparse input or dense input, may be submitted to morethan one preprocessing embedding-pooling block (e.g., EP1/EP2 orEP3/EP4), each of which provides a different embedding (latent vector)to its respective input. Elements in FIG. 8 may be similar to those ofFIGS. 3-6, but have different reference characters to emphasize that asingle input (e.g. Feature-1) may receive multiple different embeddingsby means of being submitted to multiple different embedding-poolingblocks (two or more preprocessing blocks) within the same preprocessingmodule, M_3. That is, in the present example, input Feature-1 may besubmitted to two preprocessing blocks EP1 and EP2, each of which mayprovide a different embedding, and their respective pooling thereforeprovides different intermediate outputs, 21 and 23, respectively.Similarly, a second input Feature-2 may be submitted to twoembedding-pooling preprocessing blocks EP3 and EP4, each of which mayprovide a different embedding and different pooled output, e.g., 25 and27, respectively. It is to be understood that additional contextualmeanings may be defined by submitting the same input (e.g., Feature-1)to additional embedding-pooling preprocessing blocks (3 or more), eachof which may provide a different embedding to the same input. Pairwiseinteractions between (optionally all) unique combinations of theintermediate outputs of (optionally all) the preprocessing blocks (e.g.,EP1 to EP4) may then be modeled by pairwise modeling blocks (e.g. PW1 toPW4). The outputs from the pairwise modeling blocks (e.g. PW1 to PW4)may then be combined by block Cnct_1 and submitted to a subsequentneural network layer (e.g., InL_1) or to another preprocessing module ina manner similar to that of FIG. 6. In the present example, pairwisemodeling blocks PW1 to PW4 may each apply a dot product to their inputs,and block Cnct_1 may combine its inputs by concatenation.

The mixed architecture of FIG. 8 provides for learning a mixture oflatent vectors (embeddings) for each feature, and between each pairwiseinteraction of features (e.g. pairwise interactions of each of thefeatures' multiple embeddings). In the present example, the pairwiseinteractions are provided by dot-products, but other featureinteractions may be used, such as cosine similarity. Like is explainedabove, all the weights may be learned by the MLP by backpropagation, orother known method. In this way, multiple topics (or multiple semanticmeaning categories) may be learned for each feature. Additionally foreach pair of entities (e.g. each pairwise combination), the model canlearn to put more weight (e.g., higher value weights) on suitabletopic(s), e.g., more relevant feature combination(s).

This mixed architecture can be applied to both dense and sparsefeatures. That is, the inputs to the mixed architecture may be densefeatures, sparse features, or a combination of both. In practice, it hasbeen found that dense features typically require a larger number ofdifferent representations to be learned. That is, dense features maycomprise a larger number of different contextual meanings as compared tosparse inputs. This may be due to dense features typically beingcomprised of a collection of different signal sources (e.g. informationcategories such as gender, Wi-Fi-status, time-of-day, historical data,etc.).

Optionally in embodiments, rather than submitting a dense feature tomultiple embedding blocks to obtain multiple low-dimensionalrepresentations, linear transformations (such as by use of matrices) ofthe dense feature may be used to define its multiple low-dimensionalrepresentations. However, multiple representations of sparse inputs maybe obtained by free-form embeddings, which produces multiple differentembeddings for a sparse input. If desired, multiple representations of adense feature may also be obtained by free-form embedding, as well.

In particular embodiments, the preprocessing blocks (e.g. EP1-EP4),pairwise combination blocks (PW1-PW4), and concatenation block Cnct_1 ofFIG. 8 may constitute a preprocessing module, M_3. That is, the mixedarchitecture of FIG. 8 may be arranged into a nested architecture asillustrated in FIG. 6 by replacing at least one preprocessing module(e.g., M_1 or M_2) in FIG. 6 with M_3 of FIG. 8, or by adding thepreprocessing module M_3 to the sequence of preprocessing modules ofFIG. 6.

FIG. 9 illustrates an example method for a mixed architecture neuralnetwork. In step S20, a computing device (e.g., Facebook server) mayaccess a neural network having a (preprocessing) module, and the module(e.g., M_3) has a first input (e.g., Feature-1) and a second input (e.g.Feature-2). In step S22, the module generates multiple different firstlatent vector representations (e.g., embeddings, or output 21 from EP1and output 23 from EP2) of the first input (e.g., Feature-1). In stepS24, the module generates multiple different second latent vectorrepresentations (e.g., embeddings, or output 25 from EP3 and output 27from EP4) of the second input (e.g., Feature-2). In step S26, the modulemodels pairwise interactions (e.g., by blocks PW1-PW4) between uniquepairwise combinations of the first latent vector representations and thesecond latent vector representations. In step S28, the module producesan intermediate output by combining results of the modeled pairwiseinteractions (e.g., the output of concatenation block Cnct_1).

Particular embodiments may repeat one or more steps of the method ofFIG. 9, where appropriate. Although this disclosure describes andillustrates particular steps of the method of FIG. 9 as occurring in aparticular order, this disclosure contemplates any suitable steps of themethod of FIG. 9 occurring in any suitable order. Moreover, althoughthis disclosure describes and illustrates an example method for a mixedarchitecture neural network including the particular steps of the methodof FIG. 9, this disclosure contemplates any suitable method for a mixedarchitecture neural network including any suitable steps, which mayinclude all, some, or none of the steps of the method of FIG. 9, whereappropriate. Furthermore, although this disclosure describes andillustrates particular components, devices, or systems carrying outparticular steps of the method of FIG. 9, this disclosure contemplatesany suitable combination of any suitable components, devices, or systemscarrying out any suitable steps of the method of FIG. 9.

Training the above-described ML model embodiments may pose practicalchallenges. To address some of the computational challenges to ML modeltraining, below is disclosed a two-tier distributed method/system thatmay utilize multiple processors (CPUs or GPUs), or processing cores, forbetter computational capability.

As an example, a two-tier hierarchical hybrid training method/systemrunning on multiple computer processors (e.g., GPUs or CPUs) in a singlemachine (computer) is presented. The hybrid training method/system mayincorporate different aspects of EASGD and Hogwild training techniques.In particular embodiments, the ML models may be used to model deeppersonalization, e.g., to identify personalize predictions catered toindividuals. A difficulty may arise because deep personalization modelsmay be relatively small (e.g., have 128, 64, 32, or fewer hiddenlayers). Parallel and distributed training, in general, requirecommunication and synchronization among multiple workers (processingthreads), but deep personalization training may be much more sensitiveto communication or synchronization overhead (e.g. data/network trafficcongestion) due to its relatively small kernel, or model, size. That is,a typical method to speed up the training of deep personalization modelsmay be to process multiple work threads in parallel, but since themodels are relatively small, delays caused by the passing of databetween work threads may offset any speed benefits gained from parallelprocessing.

Before discussing some of the features of the present embodiment, it maybe beneficial to first provide some background information regarding thetraining of an ML model. As is stated above, an NN ML model may betrained by backpropagation. Stochastic Gradient Descent (SGD) may beused to optimize a neural network using backpropagation to find minimaor maxima (e.g., parameter solutions) by updating each iteration with adifferent batch or “mini-batch” of samples of a training dataset(training inputs and corresponding training outputs). Interim gradientvalues (e.g., interim parameter values) may be calculated during eachiteration pass. The SGD process is inherently linear and difficult toparallelize, but there are a couple of techniques that introduce somelevel of parallelization to SGD, with some limitations.

One technique is Elastic Averaging Stochastic Gradient Descent (EASGD),which is suitable for very large NN models (typically using densefeatures) such as deep image recognition. EASGD divides a large modelinto a few parts/threads (each with its own local (weight) parameters).Each part is assigned to a different concurrent process (local worker,or thread) that maintains its own local parameters. A central mastermachine or processing block maintains a master parameter list/store thatis updated as a moving average over the local parameters computed bylocal workers. Because the local workers maintain their own localmemory, and do not work directly with the master parameter store, theirlocal parameters develop elasticity, meaning that they can fluctuatefurther from the master parameters. The idea is that EASGD enables thelocal workers to perform more exploration, where the amount ofelasticity/exploration is controlled by the amount of communicationbetween the local worker and the central master.

A GPU may have a large number of small CPUs (e.g., processing cores)that may function in parallel, and is thus well-suited for large(floating point) computations. Because of the large model size thatEASGD is designed to work with, EASGD is well suited for multi-GPUimplementations. When implementing EASGD in a multi-GPU environment,typically one assigns one worker/thread per GPU in order to fullyutilize the GPU's large number of processing cores. After somepredefined number of operations, each GPU, in turn, gains lock access tothe master parameter store, and is synchronized with the masterparameter store, which may be maintained in a designated one of themultiple GPUs. By locking the master parameter store, only one GPU mayaccess the master parameter store at a time.

Although the use of GPUs for large neural networks is attractive becauseof its capacity for large computation, it is not well-suited to smallerNN models. The ML models of particular embodiments may include deeppersonalization model, whose size is much smaller than deep imagerecognition, and which may not fully utilize the multiple processingcores in a GPU, resulting in wasted resources. Consequently,implementing an ML model of some of the present embodiments in amulti-GPU environment using a typical EASGD technique is not effective.Additionally, because of the smaller size of the present model(s),updating of interim parameter values with a master parameter store wouldbe needed more frequently. This would result in increased communicationtraffic within a GPU or across GPUs (such as to transmit parameterupdates), and delays introduced by the increased communication trafficmay nullify gains obtained from the GPU's computation capacity.

Another technique for introducing parallelization to SGD is a techniqueknown as Hogwild. In Hogwild, multiple processors have access to ashared memory without locking the shared memory. This introduces thepossibility of overwriting each other, but it has been shown that thisapproach may still converge to a solution when used with sparsefeatures, which are typically found in smaller NN models. That is,Hogwild is conventionally limited to sparse features and small NNmodels. In particular embodiments, however, the ML models of the presentdisclosure may include dense inputs and may be larger than isconventionally used with Hogwild.

Thus, the neural network models of particular embodiments may be toolarge for a typical Hogwild implementation and too small for a typicalEASGD implementation.

To address these challenges, the present hierarchical two-tier trainingarchitecture may combine features from Hogwild and EASGD in a trainingsystem running on one or more production GPU (or CPU) servers.Optionally, each production server may have multiple processors. Forexample, each production GPU server may typically have up to 8 GPUcards. That is, the training architecture, which may support acombination of dense (input) features and sparse (input) features, maydraw benefits from both Hogwild and EASGD techniques and be successfullyintegrated into a multi-processor (e.g., multi-GPU) environment.

A first tier of the present hierarchical two-tier training architecturemay address an architectural implementation within a single GPU of thepresent multi-GPU implementation. Within a single GPU (or CPU), dataparallelism may be increased by launching multiple model trainingthreads, or training workers, or user streams. Communication delays andsynchronization costs between training workers, such as described above,may be reduced by introducing additional communicator workers (orcommunicator threads) dedicated to handling communication, e.g. datatransfers. For example, communicator workers may handle communicationbetween each training worker and a fast shared memory within the singleGPU without locking the shared memory, or may handle communicationacross multiple GPUs. That is, the training workers may synchronizetheir parameters with the local shared memory in a lock-free manner.Lock free access to the local shared memory within a single GPU mayprovide some of the speed advantages of Hogwild. Unlike Hogwild,however, the present training system/method is further spread acrossmultiple GPUs as part of the present hierarchical two-tier trainingarchitecture. In essence, each GPU may have an extra communicator workerto communicate and exchange information between multiple GPUs. Asanother example, a single GPU may have a total of 50 to 100 workersrunning, but only 4 to 8 workers may be communication workers involvedin (e.g., solely dedicated to) communication, or cross-GPUcommunication. Optionally, cross-GPU communication may rely on sharedGPU-Direct memory access, which may be relatively fast.

A second tier of the present hierarchical two-tier training architecturemay address an architectural implementation across multi-GPUs. Formultiple GPUs within the same server, parallelism may be increased bysplitting the parameter (e.g., weight or gradient) data across themultiple GPUs, with each of the multiple GPUs holding its own localparameter data, as stated above regarding the first tier of the presenthierarchical two-layer training architecture. A master parameter listmay be held remote from the multiple GPUs, and routinely separatelyupdated by each of the multiple GPUs, in turn. Alternatively inparticular embodiments, one of the multiple GPUs may be designated tohold the master parameter list, and the remaining of the multiple GPUsmay routinely updated their local parameter data to the master parameterlist.

Modern GPUs (or GPU-based cards) may have a large number of processingunits (small CPUs or cores or single instruction multiple data (SIMD)cores). For example, the NVidia Corporation's Kepler K40 GPU-based cardhas a total of 2880 SIMD cores, and the NVidia Corporation's Maxwell M40has a total of 3072 SIMD cores. Deep personalization may have arelatively small kernel, or model size, (as compared to other ML models,like deep image), which may not be enough to fully utilize theprocessing units in a modern GPU-based card.

FIG. 10 illustrates an arrangement of multiple training workers TW and alocal, shared parameter memory 31 within a single GPU. To increase thethroughput and utilization of available resources (e.g. the large numberof internal cores) within a single GPU, multiple training workers TW(usually 10 to 30 workers) may be launched in a form of CUDA (ComputeUnified Device Architecture) user streams, which can run concurrently onthe same GPU. CUDA is a parallel computing platform and applicationprogramming interface (API) for use with NVidia Corporation GPU-basedgraphics cards. Each training worker TW may process its own copy (orpart) of the present ML models (e.g., a deep personalization ML model).In the present parallel process of FIG. 10, each training worker TW mayprocess a separate batch of input samples and execute a training pass(e.g., iteration) independently. The different trainer workers TW mayuse a shared set of training parameters maintained in shared memory 31on the same GPU, which may be accessed without lock. Every trainingworker TW may update the shared parameters in shared memory 31 withoutaccessing/releasing a lock in a lock-free manner (so potentially theymay overwrite each other's results). However, it has previously beenshown in work related to Hogwild's lock-free memory access, that undercertain conditions such as in a sparse update pattern, the overwritingmay be rare and lock-free access is likely to converge to an answer. Thepresent within-GPU parallelism approach has likewise been found to havegood convergence in practice for the present deep personalizationapplications, and potentially be very efficient with virtually no (orminimal) communication and synchronization overhead.

In practice, several optimizations were made in order to maximize thespeedup of the present GPU-based trainer. For example, based on CUDAprofiling, it was found that some user streams (training workers) werebeing blocked by a default stream (a CUDA operational setting) for someoperations. The present training workers were optimized to avoid usingthe default stream. In addition, all memory copies between CPU and GPUwere made asynchronous using a pinned memory, to faceplate theimplementation of parallel copying and training processes.

The present single-GPU application may provide improved speedperformance, but if the Hogwild-like approach were to be spread acrossmultiple GPU, the amount of speed improvement may be minimal. A reasonmay be that cross-GPU memory access may be much slower than memoryaccess within a single GPU. For example, with production K40 or M40servers, the within-GPU memory access can reach speeds of up to 200 GB/swhile the cross-GPU memory access may be up to 10 GB/s, or about a 20×slower. So, when every training worker TW needs to access a sharedcross-GPU memory (memory located in a remote GPU) during training, thecommunication overhead simply dominates and the resulting speed-up from8 GPUs may be only marginally better than the single-GPU case.

In order to avoid this communication overhead, a different paralleltraining architecture for cross-GPU operations is presented as thesecond tier in the present hierarchical two-tier trainer architecture.That is, the first tier addresses implementation within a single-GPU,and the second tier addresses implementation across multiple processors(e.g., multiple GPUs or CPUs).

FIG. 11 illustrates an example implementation of a hierarchical two-tiertrainer. All elements in FIG. 11 similar to those of FIG. 10 havesimilar reference characters and are described above. Inside each(trainer) GPU (e.g., GPU #0 and GPU #1), which corresponds to the firsttier, there may be multiple training workers (TW and TW′) executing aHogwild-like application as described above in reference to FIG. 10.Within each (training) GPU, GPU #0 or GPU #1, its respective trainingworkers, TW or TW′, access only their respective local shared memory 31or 31′, which resides on the same GPU and avoids all cross-GPU memoryaccesses. As part of the second tier, each (training) GPU (GPU #0 andGPU #1) may have at least one additional special (communicator) worker(CW and CW′, respectively) responsible for synchronizing its local copy(31 and 31′, respectively) of (weight) parameters with a master copymemory 33, which may be remote from either of GPU #0 and GPU #1. Thatis, the communicator worker may be (solely) in charged (and dedicatedto) data transfer between a GPU and a remote master parameter memory 33.Optionally, the master parameter memory 33 may be maintained in anotherGPU (e.g., GPU #N). Periodically, the local shared memories 31 and 31′from local worker GPUs (GPU #0 and GPU #1) may separately be exchangedand mixed with the master parameter memory 33, which may be based on aconcept of elastic differences as used, for example, in EASGD explainedabove. In the present two-tier architecture, only a small number of(communicator) workers (usually 4 to 8 workers out of the 50 to 100workers) experience the cross-GPU communication overhead, while thetraining workers only access the local shared memory.

The first tier addresses implementation within each individual GPU, butML Model data is split across multiple GPUs. In order to make use of themany cores within each GPU, the ML model data of each GPU is furtherdivided into multiple (50-100) model threads (training workers) to runin parallel. Rather than assigned each training worker its own localmemory like in EASGD, all the workers within a GPU share a common localmemory without lock, which provides some of the speed benefits ofHogwild. However, whereas in Hogwild the shared memory would be themaster memory, in the present case, the shared memory of a GPU is alocal partial parameter memory (like in the multi-GPU implementation ofEASGD) and the master memory is maintained at an external location.

In summary, the second tier addresses the management of the multipleGPUs (two or more) and the management of a master parameter memory. Oneof the GPUs (GPU #N) may be designated to hold the master parametermemory 33. At predetermined times (e.g., after a predefined number ofbackpropagation integrations), each GPU, in turn, synchronizes its localparameter memory (e.g. 31) with the master parameter memory 33. Duringsynchronization with a given GPU (e.g. GPU #0), the master parametermemory 33 is locked from access from any other GPU (e.g. GPU #1). Inthis manner, the master memory may be updated as a moving average overthe local parameters computed from the multiple GPUs, which providessome of the elasticity benefits of EASGD.

In order to mitigate delays due to cross-GPU communications, eachtraining GPU may further be augmented with a small group of communicatorworkers CW (e.g., 4 to 8) dedicated to synchronizing a GPU's localparameter memory (e.g., 31) with the master parameter memory 33. In thismanner, the GPU's other (50-100) training workers, or model threads,(e.g., TW) are not interrupted by the synchronization of their sharedlocal parameter memory (e.g., 31) with the master parameter memory 33.

In practice, it was found that the mixture of EASGD techniques andHogwild techniques had convergence problems (difficulty findingparameter solutions). In an example implantation, convergence problemswere traced to some hyper-parameters (operational settings) related tothe EASGD algorithm. The problem was resolve by adjusting theseoperational settings and fine tuning the learning rate of the NN model.To remove the convergence problems, the EASGD operational settings weremodified to increase the moving rate, lower the Nesterov momentum, anddecrease the communication period.

FIG. 12 illustrates another example training system for training an MLmodel. FIG. 12 shows a master controller 41, a reader machine 45 thatmay pre-fetch training data, a parameter server 47, and a trainermachine 49, all of which may communicate with each other over a computernetwork. The example of FIG. 12 incorporates features of asynchronousSGD to a combined Hogwild-EASGD architecture, an example of which isprovided above in reference to FIGS. 10 and 11. Asynchronous SGD is ascalable method of distributing SGD across multiple processors. Thebasic approach of Asynchronous SGD is to divide training data into anumber of subsets, and to use each subset to train a separate full copyof an ML model. The multiple ML models communicate parameter (weight)updates through a centralized parameter server (which keeps the currentstate of all parameters for the ML model) sharded across many machines.That is, each machine that makes up the parameter server holds aseparate shard (piece or part) of the total parameters. For example, ifone has 10 parameter server shards, each shard is responsible forstoring and applying updates to 1/10th of the total ML model parameters.

By contrast, in the present approach, the training data is not divided,but a single ML model may be divided into multiple parallel processingstreams, as explained above. Additionally, the present approach mayshard a master parameter store across multiple machines, which may beupdated asynchronously.

As stated above, GPU machines (machines that may have many smallprocessor cores in a graphic processing unit) may be used to handlepreprocessing work. In particular embodiments, GPU machines may beidentified as “readers”. The preprocessed data from the GPU machines maybe streamed to CPU machines (machines that have one or more dedicated,multi-purpose CPUs) that process the received preprocessed data (e.g.,train the NN ML model using backpropagation) to extract information,such as inferences between input data terms (features). In particularembodiments, CPU (or GPU) machines may be termed “readers” or“trainers”, depending upon their primary use. In general, “reader”machines stream their output to “trainer” machine.

In an example embodiment, aspects of asynchronous SGD may be applied tosome of the preprocessing work. Firstly, parameters may be sharded(divided into subsets or model shards) across multiple machines 51 of aparameter server 47 (or across multiple parameter servers 47), whichcommunicate with one or more “trainer” machine 49. In addition toholding a model shard 51, the parameter server(s) 47 may further provideembeddings (e.g., they may hold embedding tables) for input features(dense or sparse), and if a resulting, active embedding is large (e.g.,an input vector had a large number of cells (e.g., greater than 64)resulting in a larger number of embeddings, e.g., one embedding percell), the parameter server 47 may further reduce the size of theoverall embeddings by applying pooling across the embeddings, asexplained above (see FIG. 4). If the embedding is small (e.g., notgreater than 64), the parameter server 47 may send the active embeddingsto the trainer machine 49, where they may be pooled into a smaller size,as explained above. A reason for selectively pooling either on theparameter server 47 or on the trainer machine 49 may be to reduce datatraffic on the computer network. The trainer machine 49 may combinepairs (e.g., unique pair combinations) of pooled features by dotproduct, or other combining method (see FIGS. 4-6 and 8). Alternatively,if the data size after pooling at the parameter server 47 is stilldetermined to be large, e.g., within a predefined size range, theparameter server 47 may combine pairs of pooled features by dot-productand send the resultant vector to trainer machine 49.

The trainer machines 49 may use local workers (e.g., training threads)53 to process data and compute local gradients on a mini-batch; forexample in a manner as explained above in reference to FIGS. 10 and 11.The workers 53 may send (push) gradient updates to corresponding modelshards 51 in parameter server 47, which process the updatesasynchronously. When needed, the workers 53 may pull parameters backfrom the parameter server 47. The master controller machine 41 maycoordinate multiple trainers 49 and parameter servers 47. The readermachine 45 may pre-fetch data (e.g., training data) to the trainingmachine(s) 49, which may forward the received training data (or a partof the received training data) from, for example, a prefetching space 55to the parameter server 47 for preprocessing (e.g., embedding, pooling,applying dot-products, etc.), if necessary.

In an example implementation, the trainer machine(s) 49 may implementHogwild, and periodically (e.g., after each pass/iteration, or after apredefined number of passes/iterations) push their gradientchanges/updates to the appropriate model shard 51 in the appropriateparameter server 47. That is, each trainer 49 may have access to allmodel shards 51 in all the parameter servers 47, and may address aparameter server 47 in accordance with the parameter shard 51 that needsupdating.

Like in the Mixed Hogwild/EASGD case described above, the Hogwildtrainers 49 may maintain a local parameter memory (for example sharedlocal parameter memory 31 in FIG. 10) and the parameters servers 47 maymaintain the master parameter memory (similar to master parameter memory33 in FIG. 11) in shards 51 averaged across multiple Hogwild trainers 49so that they function in a manner similar to EASGD. Additionally in theembodiment of FIG. 12, the trainers 49 may further dedicate a smallgroup of workers (similar to communicator workers CW of FIG. 11) tosynchronizing their local parameter memory with the master parametermemory (shards 51) in the parameter server(s) 47. The trainer machines49 may further have background threads 57 that may apply EASGD to densefeatures (dense inputs) and update dense parameters in appropriate modelshards 51, as needed. The trainers 49 may be implemented in dedicatedCPUs or in GPUs (e.g., in CPU-based machines or GPU-based machines).

Master controller machine 41 may help manage the interactions or dataflow between the machines. Master controller 41 may function as a leadermachine that provides basic cross-machine communication primitives, suchas a global signal, a global barrier and a global counter. The othermachines, such as reader 45, trainer 49 and parameter server 47, andother workers, may use it as a central service to wait for signalsgenerated by the other machines or gather information, such as socketaddresses, from other machines. Master controller machine 41 may alsohelp to properly manage the ending of a data stream between machines(e.g. participants in the data stream). For example, when a firstparticipant finishes a data stream operation (e.g., finishes datareading or writing) with a second participant, the first participant maywrite as signal indicating that it has finished to master controllermachine 41. The second participant in the data stream operation maycheck this signal in master controller machine 41 when the data streamhas been empty for a predefined period of time.

Optionally, reader machine(s) 45 may provide filtering and shardinglogic that may help stream different data to different machines orstream duplicate data to multiple trainers 49. In this manner, multipletrainers 49 may share data. The parameter server 47 may optionally alsohave a separate, dedicated thread (worker thread) for each of modelshard 51 handling both pull and push request to avoid using any lock(e.g., memory lock).

In a particular embodiment, a basic operation of trainer 49 may include,for each mini-batch (e.g. training data received from reader 45): pullparameters from parameter server 47 if necessary; run forward andbackward pass for the model and get gradients; update local model (e.g.a shared memory 31, as in FIG. 10); and send (at least updated)gradients to parameter server 47. Push and pull operations (to/fromparameter server 47) may be done in a asynchronous fashion, or may alsobe done after a predetermined number of mini-batches. Alternatively, thelocal parameters may be locally kept within a trainer 49 andsynchronized with parameter server 47 less frequently. This approach maybe applied to sparse or dense features, but sparse features that appearfrequently may become stale more quickly. In particular embodiments,this method may be limited to dense features.

As explained above, the trainer 49 may implement a Hogwild-like approachsimilar to that described in FIG. 10, which means that multiple trainingthreads 53 share a local memory, not shown. Additionally to obtain someof the benefits of EASGD, the background thread 57 may provide dedicateddata communication service (similar to communicator worker CW in FIG.11) to manage updates to the master parameter memory, which in thepresent embodiment may be embodied by the collection of model shards 51.

FIG. 13 illustrates an example method for a training system to train anML model. In step S60, operations associated with a neural network modelare separated into multiple separate portions. In step S62, each of theseparate portions is assigned for execution to one of a multipleprocessing units (e.g., GPU #0 and GPU #1) of a computer. In step S64,within each processing unit (e.g., GPU #0), divide its assigned portionof the neural network model for execution among a first set ofoperational (processing) threads (e.g., TW). The first set ofoperational threads (e.g., TW) has lock-free access to a local sharedmemory (e.g., 31) within its respective processing unit (e.g., GPU #0),and stores interim execution values to the local shared memory. In stepS66, the multiple processing units (e.g., GPU #0 and GPU #1) are grantedlock access to a remote shared memory (e.g., 33) external to theplurality of processing units. In step S68, within each processing unit(e.g. GPU #9), define a second set of operational threads (e.g., CW)dedicated to data transfers between the respective processing unit'slocal shared memory (31) and the remote shared memory (33) by lockaccess.

Particular embodiments may repeat one or more steps of the method ofFIG. 13, where appropriate. Although this disclosure describes andillustrates particular steps of the method of FIG. 13 as occurring in aparticular order, this disclosure contemplates any suitable steps of themethod of FIG. 13 occurring in any suitable order. Moreover, althoughthis disclosure describes and illustrates an example method for atraining system to train an ML model including the particular steps ofthe method of FIG. 9, this disclosure contemplates any suitable methodfor a training system to train an ML model including any suitable steps,which may include all, some, or none of the steps of the method of FIG.13, where appropriate. Furthermore, although this disclosure describesand illustrates particular components, devices, or systems carrying outparticular steps of the method of FIG. 13, this disclosure contemplatesany suitable combination of any suitable components, devices, or systemscarrying out any suitable steps of the method of FIG. 13.

After the ML model has been trained, the implementation of an ML modelhaving both dense inputs and sparse inputs, as described above, maybenefit from additional optimization for an operational stage. As isexplained above, in particular embodiments, the ML models may include acombination of user features (e.g., dense features) and semanticfeatures (sparse features) that may be related to particular userfeatures. The sparse features may effectively represent a candidate item(e.g., an ad, newsfeed item, etc.) that may be of interest to the user,and execution of the ML model may identify which candidate item(s)(among multiple available candidate items) may be of most interest tothe user. In particular embodiments, each ML model may consider a userinput (or request) and one (or a small number, e.g. not more than 10) ofthe available candidate items as an information pair (more specifically,as user/request-and-candidate item pair), and provide a prediction value(e.g., probability value) for this particular pair, which may then becompared with prediction values of other pairs to identify the optimalpair(s) having the highest prediction values. Therefore multipleinstances of the ML model may be executed to consider multipleuser/request-and-candidate item pairs to consider multiple candidateitems, or to consider multiple candidate items for multiple differentusers. Additionally as explained above, the sparse inputs may needembedding to define latent vectors, and although the embeddings willhave already been defined (e.g., embedding matrices will have beentrained), large memory capacities may be needed to store the trainedembedding matrices. Also is as explained above, the user features (e.g.dense inputs) may be large and require high computing capacity toprocess. Because of the large size of user features, the transfer ofmany user features across a computer network may introduce data-transfercongestion into the computer network. Thus, the processing of an MLmodel that combines dense feature inputs and sparse feature inputs mayplace conflicting hardware requirements on system architecture. Below ispresented a system architecture that addressed some of the practicalhardware difficulties of executing an ML model in accord with particularembodiments, and in particular with an ML model that has a combinationof dense feature inputs and sparse feature inputs.

In particular embodiments, computer processing of a trained (Sparse NN)ML model may be split between at least one local machine and at leastone remote machine, over a computer network. The local machine, whichmay be a local ranking machine (e.g., a Facebook server), may becharacterized by a computer architecture that emphasizes computationalpower over memory availability. The remote machine (e.g., anotherFacebook server), which may be a back-end service such as remotepredictor (or a parameter server), may be characterized by a computerarchitecture that emphasizes memory storage capacity over computationalpower. In addition to differences in computational resources, the localmachine and the remote machine may have access to different data sets(e.g., the local machine may have access to (e.g., receive as input)user features and the remote machine may have access to (e.g., store)trained embedding matrices). Output results of the remote machine maythen be sent to the local machine, where they may be merged with outputsfrom the local machine according to the trained (Sparse NN) ML model.

FIG. 14 illustrates an example, simplified, operation nodal model 70,e.g., a nodal graph model of a trained (NN) ML model. After an ML model(such as described above in particular embodiments) has been trained(such as described above), and the ML model parameters (e.g.weights/gradients) have therefore been determined/learned, the trainedML model may be converted to one (or more) operational nodal model(s)70. The operational nodal model 70 may break down the trained ML modelinto discrete operations sequences. Each operation (or optionallyrelated group of operations) may be designated a node (e.g., 71 to 78)in an operational nodal model 70, with links (interconnections) (81 and89) between nodes corresponding to operational relationships betweenoperations of the neural network (e.g., indicating data transfersbetween nodes). As is illustrated, as an example, in regards to node 74,each node may identify its input count (number of inputs), input type(s)(e.g., dense feature, sparse feature, user-related feature, etc.),operation(s) it provides (e.g., embedding, dot product, mathematicaloperator, non-linear function, etc.), or needed operational resources(e.g., computation intensity level, memory usage level, etc.). Theoperation nodal model 70 may be segmented (e.g., split or divided) intomultiple graph-segments.

FIG. 15 illustrates an example of the operation nodal model 70 of FIG.14 divided into multiple graph-segments (91 to 94). Optionally, thegraph-segments may be configured to be sufficiently self-contained sothat each may be processed (executed) independent of each other, as muchas practical. Individual graph-segments may be distributed (designated)for execution to specific machines (e.g., the local machine or remotemachine as described above) that have the appropriate resources (e.g.,high computational resources or high data storage resources) forexecuting the individual graph-segments. For example, compute intensivegraph-segments may be designated for processing within the local machine(as indicated by an “LM” node designation in FIG. 15), and memoryintensive graph-segments may be designate for processing on the remotemachine (as indicated by an “RM” node designation). Optionally, themachine designation may also take into account network trafficcongestion. For example, if a particular dense feature input requiresembedding, and the embedding tables are stored on the remote machine,then it may be advisable to designate the node that applies embedding tothe dense input for execution on the remote machine. But since densefeature inputs may be large, the transfer of the large dense featureinput from the local machine to the remote machine may slow down thecomputer network. In this case, the node that applies embedding to thedense input may be designated for execution on the local machine, andthe local machine may be configured to hold trained matrices needed forgenerating low-dimensional representations of dense features, such as byembedding or by linear transformation. Irrespective, the output resultsof executing graph segments on the remote machine or local machine maybe sent to a merge processing block where they may be merged into areconstruction of the graph representation of the original ML model 70,and a final result is determined. Optionally, the merge processing blockmay reside within the local machine.

Machine designation of a node may be determined using any of severalmethods/systems/mechanisms. For example, an operational cost value ofeach node may be estimated, such as by means of a cost function, and theoperational cost value may be used to determine whether a graph nodereceives a machine designation indicting preferred execution withinlocal machine (having a higher computational capacity) or preferredexecution within the remote machine (having a higher memory storagecapacity). For example, a cost function may evaluate each node, or groupof nodes, based on estimated computational requirements and memory usage(and optionally the node's number of inputs), and thereby determine itsmachine designation. The number of inputs may be relevant since, inparticular embodiments, the local machine receives all inputs, and theinputs to a node may need to be transferred over the network from thelocal machine to the remote machine. Since it is desirable to minimizenetwork traffic, if the number of inputs to a node is higher than apredefined value, then the cost value of that node may be weighed towardexecution on the local machine in order to avoid transfer of all theinputs across the network.

The cost value may also be based on the input type (e.g. dense featureor sparse feature) of the graph node or operational resources needed bythe graph node. In particular embodiments, nodes that have a sparsefeature input type may be designated for preferred execution on theremote machine (e.g. the machine having higher memory resources), andnodes that have a dense feature input type may be designated forpreferred execution on the local machine (e.g. the machine having ahigher computational capacity). The operational cost value may also bebased on a node's operation (e.g., multiplication, addition, embedding,dot product, etc.), parameters, or output. For example, a cost functionmay be used to quantify the cost of operation based on, e.g., the amountof read/write data access required, the type of operation performed(e.g., a database query is computationally cheaper than a database joinjunction), the number of inputs and parameters that need to beprocessed, etc. The cost characteristics of each node may be used todetermine whether it is suitable for local or remote processing. Theoperation nodal model 70 may then be segmented into multiplegraph-segments (e.g., 91-94) based on the operational cost value foreach graph node. That is, graph nodes that are linked together and havea similar machine designation may be grouped into a graph segments thatare assigned for execution on a particular machine. Optionally, thegraph segments may be selected so as to ensure that no nodes designatedfor local execution are dependent upon remote intermediate data/results,and no nodes designated for remote execution are dependent upon localintermediate data/results. Nonetheless, the results of the processedgraph segments (e.g., intermediate data results) are sent to the mergeprocessing block (within the local machine), where they are joined inaccordance with the operation nodal model 70. Optionally, processing ofany graph segment that needs an intermediate result may be finishedwithin the merge processing block.

A cost function, and thus machine designation of a node, may also bebased on a nodes operation. Nodes whose operations predict/selectcandidate items (such as ads) may be identified. Typically, thesecandidate items are not directly related to user features. For example,a particular webpage that a user visited may have a list of candidateitems (e.g. ads) associated with it. This association of candidate itemsis related to the individual webpage and not dependent upon theindividual user. However, the node(s) is expected to evaluate the listof candidate items and make inferences about the user that visited thewebpage to rank (identify) which ads may be most relevant to the user.These nodes need to identify relationships between pairs of inputs, andmay be associated with embedding tables/matrices. Use of embeddingtables may require higher amounts of memory. Therefore, optionally,nodes associated with embedding tables may be designated for evaluationon the remote machine. That is, (select) embedding tables may be kept onthe remote machine (e.g., remote predictor), and nodes whose operationsrequire access to these embedding tables may be designated for remoteexecution. Conversely, nodes whose operations depend only on inputfeatures and parameters that do not require embedding tables may bedesignated for execution on the local machine. Additionally, graph nodesthat define operations (such as dot products) on only embedding resultsfrom the remote predictor may be designated for execution on the remotemachine to limit transmission of embedding vectors across the network.

Execution of the operation nodal model 70 may further includeidentifying individual nodes, or subsets of nodes, whose operationsdepend only on user features (features/characteristics dependent on (ordescriptive of) an individual user/person) such as webpages the uservisited, “liked”, “shared”, commented upon, etc. These nodes may bedesignated to be executed only once, and their results may be sent overthe network, if needed, only once. In the present example, these nodesmay be evaluated on the local machine, and the results sent over thenetwork to the remote machine only once. The remote machine may maintaina copy and send copies locally to any graph nodes within the remotemachine that need such information. For example, if it is desirable toexecute multiple instances of the operation nodal model 70(corresponding to an NN ML model that evaluates auser/request-and-candidate item pairs, as explained above) that have thesame user features as input (correspond to the same user/request), thelocal machine (which may receive all inputs) may send the differentcandidate items (sparse feature inputs) across the network to the remotemachine, but send the user/request (user features) across the network tothe remote machine only once. The remote machine may use the same copyof the user features (or processed user features received from the localmachine) to evaluate the graph segments of the multiple instances of theoperation nodal model 70 that are assigned for execution on the remotemachine.

FIG. 16 illustrates an example, optimized data path flow between a localmachine 101 and a remote machine 103. As is explained above, the MLmodel may be represented as a graph of operations and parameters, whichmay be executed within an NN learning framework, such as Facebook'sCaffe2 NN framework. Each node (as illustrated in FIGS. 14 and 15) maybe characterized by its compute requirements (e.g. floating pointoperations per second, FLOPS, of the operator) and memory requirements(e.g., size of the parameters). In a serving setting, a ranking servicefor a given request from a single user may need to evaluate a model onseveral (usually hundreds) candidate items (e.g. ads). A single rankingservice machine may need to be able to predict several different modelsat the same time, and all of those models might not feed into a singlemachine memory. On the other hand, because of structure of SparseNN andthe large number of dense features used, model evaluation may not becompletely offloaded to the remote machine. Additionally, sending all ofthem over a wire (network) may not be optimal. Also in some cases, it isbeneficial to concentrate compute-intensive work inside the rankingservice which is optimized for it.

Another consideration is that some parts of the model may depend only onuser/request features and thus would be the same for each of thecandidate items ranked (e.g. embedding matrix that depends on userfeatures). A practical implementation (setup) may involve splitting the(SparseNN-like) ML model into several parts (e.g. graph segments) tooptimize computational efficiency. For example, the part of the modelthat depends exclusively on user/request features may get executed oncefor the entire batch of candidates. The model may also be split betweena local (ranking) machine and a remote (predictor) machine such that theamount of intermediate results sent over the network is minimized whilea limit on memory is imposed on the local part and a limit on computeintensity is imposed on the remote part. Machine designation of a node,may at least in part, be based on these imposed designations.

Based on above considerations the model may be divided into multipleparts (“nets” in Caffe2 terms), and an execution engine that handlespassing of intermediate results between them may be implemented.

In the example of FIG. 16, the local machine 101, which may be a rankingserver, may execute most of the compute-intensive operations, and theremote machine 103, which may be a remote predictor machine, may executemost of the memory-heavy operations. The local machine 101 and remotemachine 103 may communicate with each other across a computer network105. In operation, the local machine 101 may face remote users andreceive all user inputs, including user/request features 107. As isexplained above, all or part of user/request features 107 may beexecuted on local machine 101 or on remote machine 103. Optionally,operations 109 on user/request features 107 that may not involve otherinputs (e.g. preprocessing operations) may be executed only once on thelocal machine 101 (e.g. local shared parts 111) or on the remote machine103 (e.g. remote shared part 113) or both. If the remote machine 103needs user/request features for processing (e.g., to process a graphsegment that may need a user/request feature), then the (needed)user/request features may be transferred (from local machine 101 toremote machine 103) across network 105 only once.

The local machine accesses the sparse input (e.g., candidate itemfeatures 117), and processing block 115 may executeuser/request-and-candidate item pairs, as discussed above. For example,local per-candidate part block 119 may execute graph segments (oroperational nodes) that process user/request-and-candidate item pairswithin local machine 101, and remote per-candidate part block 121 mayexecute graph segments (or operational nodes) that processuser/request-and-candidate item pairs within remote machine 103. Thelocal per-candidate part block 119 may receive user/request features(e.g., dense inputs) directly from user/request features 107 since theyare both on the same local machine 101. Sparse inputs (e.g., candidateitem features) may be transferred from local per-candidate part block119 across network 105 to remote per-candidate part block 121. Remoteshared part 133 may provide remote per-candidate part block 121 withuser/request features (e.g., dense feature inputs). The processedresults from local per-candidate part block 119, remote per-candidatepart block 121, and remote shared part 113 may be transferred to a mergepart (e.g. merge processing block) 123 to be combined and obtained afinal model result evaluated, as is explained above. Block 125 may thencollect (or transmit to a remote user) the model evaluation result(e.g., prediction).

FIG. 17 illustrates an example method for the operational stage of atrained ML model divided between two machines. The method may begin atstep 131, where a nodal graph model (e.g., 70) of a neural network isaccessed, where graph nodes (e.g., 71-78) of the graph model correspondto operations of the neural network and interconnections (e.g. 81-89)between graph nodes correspond to operational relationships betweenoperations of the neural network. The graph model identifies inputs tograph nodes and operational resources needed by graph nodes (e.g., seenode 74 of FIG. 14). Step 133 determine an operational cost value foreach of a plurality of graph nodes based on a type of data input to eachgraph node and operational resources needed by each graph node. Theoperational cost value may be used to determine whether an associatedgraph node is assigned a machine designation (e.g., M1 or M2 in FIG. 15)indicting preferred execution within a first machine or preferredexecution within a second machine. The first machine (e.g., 101) and thesecond machine (e.g., 103) may be remote from each other and have accessto each other via a computer network (e.g., 105). In step 135, the nodalgraph model is segmented into a plurality of graph-segments (e.g., 91-94in FIG. 15) based on the operational cost value for each graph node.Each graph-segment may contain a subset of the graph nodes and a subsetof the interconnections. The graph nodes in the subset may beinterconnected by the subset of the interconnections. In step 137, thefirst machine (e.g., 101) is assigned to execute operations associatedwith a first of the plurality of graph-segments (e.g., 91). In step 139,the second machine (e.g., 103) is assigned to execute operationsassociated with a second of the plurality of graph-segments (e.g., 92).Step 141 transfer the operations corresponding to the subset of graphnodes in the first of the plurality of graph-segments to the firstmachine for execution, and transfers the operations corresponding to thesubset of graph nodes in the second of the plurality of graph-segmentsto the second machine for execution. The first machine (e.g., 101) maybe configured to process outputs (e.g., by Merge 123) from thegraph-segments executed within the first machine (e.g., 101), and toprocess outputs from the graph-segments executed within the secondmachine (e.g., 103) in accordance with the nodal graph model (e.g., 70)to determine an output (e.g., 125) for the neural network.

Particular embodiments may repeat one or more steps of the method ofFIG. 17, where appropriate. Although this disclosure describes andillustrates particular steps of the method of FIG. 17 as occurring in aparticular order, this disclosure contemplates any suitable steps of themethod of FIG. 17 occurring in any suitable order. Moreover, althoughthis disclosure describes and illustrates an example method for theoperational stage of a trained ML model divided between two machinesincluding the particular steps of the method of FIG. 17, this disclosurecontemplates any suitable method for the operational stage of a trainedML model divided between two machines including any suitable steps,which may include all, some, or none of the steps of the method of FIG.17, where appropriate. Furthermore, although this disclosure describesand illustrates particular components, devices, or systems carrying outparticular steps of the method of FIG. 17, this disclosure contemplatesany suitable combination of any suitable components, devices, or systemscarrying out any suitable steps of the method of FIG. 17.

Above, local machine 101 may face remote users and receive inputs from,and provide services (e.g. candidate items/predictions) to the users.These users may be part of a social graph, as explained below, and beaccessed via a network environment. FIG. 18 illustrates an examplenetwork environment 1800 associated with a social-networking system.Network environment 1800 includes a user 1801, a client system 1830, asocial-networking system 1860, and a third-party system 1870 connectedto each other by a network 1810. Although FIG. 18 illustrates aparticular arrangement of user 1801, client system 1830,social-networking system 1860, third-party system 1870, and network1810, this disclosure contemplates any suitable arrangement of user1801, client system 1830, social-networking system 1860, third-partysystem 1870, and network 1810. As an example and not by way oflimitation, two or more of client system 1830, social-networking system1860, and third-party system 1870 may be connected to each otherdirectly, bypassing network 1810. As another example, two or more ofclient system 1830, social-networking system 1860, and third-partysystem 1870 may be physically or logically co-located with each other inwhole or in part. Moreover, although FIG. 18 illustrates a particularnumber of users 1801, client systems 1830, social-networking systems1860, third-party systems 1870, and networks 1810, this disclosurecontemplates any suitable number of users 1801, client systems 1830,social-networking systems 1860, third-party systems 1870, and networks1810. As an example and not by way of limitation, network environment1800 may include multiple users 1801, client system 1830,social-networking systems 1860, third-party systems 1870, and networks1810.

In particular embodiments, user 1801 may be an individual (human user),an entity (e.g., an enterprise, business, or third-party application),or a group (e.g., of individuals or entities) that interacts orcommunicates with or over social-networking system 1860. In particularembodiments, social-networking system 1860 may be a network-addressablecomputing system hosting an online social network. Social-networkingsystem 1860 may generate, store, receive, and send social-networkingdata, such as, for example, user-profile data, concept-profile data,social-graph information, or other suitable data related to the onlinesocial network. Social-networking system 1860 may be accessed by theother components of network environment 1800 either directly or vianetwork 1810. In particular embodiments, social-networking system 1860may include an authorization server (or other suitable component(s))that allows users 1801 to opt in to or opt out of having their actionslogged by social-networking system 1860 or shared with other systems(e.g., third-party systems 1870), for example, by setting appropriateprivacy settings. A privacy setting of a user may determine whatinformation associated with the user may be logged, how informationassociated with the user may be logged, when information associated withthe user may be logged, who may log information associated with theuser, whom information associated with the user may be shared with, andfor what purposes information associated with the user may be logged orshared. Authorization servers may be used to enforce one or more privacysettings of the users of social-networking system 30 through blocking,data hashing, anonymization, or other suitable techniques asappropriate. In particular embodiments, third-party system 1870 may be anetwork-addressable computing system that can host a third partywebpage. Third-party system 1870 may generate, store, receive, and sendcontent, such as, for example, ads identified by social-networkingsystem 1860. Third-party system 1870 may be accessed by the othercomponents of network environment 1800 either directly or via network1810. In particular embodiments, one or more users 1801 may use one ormore client systems 1830 to access, send data to, and receive data fromsocial-networking system 1860 or third-party system 1870. Client system1830 may access social-networking system 1860 or third-party system 1870directly, via network 1810, or via a third-party system. As an exampleand not by way of limitation, client system 1830 may access third-partysystem 1870 via social-networking system 1860. Client system 1830 may beany suitable computing device, such as, for example, a personalcomputer, a laptop computer, a cellular telephone, a smartphone, atablet computer, or an augmented/virtual reality device.

This disclosure contemplates any suitable network 1810. As an exampleand not by way of limitation, one or more portions of network 1810 mayinclude an ad hoc network, an intranet, an extranet, a virtual privatenetwork (VPN), a local area network (LAN), a wireless LAN (WLAN), a widearea network (WAN), a wireless WAN (WWAN), a metropolitan area network(MAN), a portion of the Internet, a portion of the Public SwitchedTelephone Network (PSTN), a cellular telephone network, or a combinationof two or more of these. Network 1810 may include one or more networks1810.

Links 1850 may connect client system 1830, social-networking system1860, and third-party system 1870 to communication network 1810 or toeach other. This disclosure contemplates any suitable links 1850. Inparticular embodiments, one or more links 1850 include one or morewireline (such as for example Digital Subscriber Line (DSL) or Data OverCable Service Interface Specification (DOC SIS)), wireless (such as forexample Wi-Fi or Worldwide Interoperability for Microwave Access(WiMAX)), or optical (such as for example Synchronous Optical Network(SONET) or Synchronous Digital Hierarchy (SDH)) links. In particularembodiments, one or more links 1850 each include an ad hoc network, anintranet, an extranet, a VPN, a LAN, a WLAN, a WAN, a WWAN, a MAN, aportion of the Internet, a portion of the PSTN, a cellulartechnology-based network, a satellite communications technology-basednetwork, another link 1850, or a combination of two or more such links1850. Links 1850 need not necessarily be the same throughout networkenvironment 1800. One or more first links 1850 may differ in one or morerespects from one or more second links 1850.

FIG. 19 illustrates example social graph 1900. In particularembodiments, social-networking system 1860 may store one or more socialgraphs 1900 in one or more data stores. In particular embodiments,social graph 1900 may include multiple nodes—which may include multipleuser nodes 1902 or multiple concept nodes 1904—multiple edges 1906connecting the nodes. Example social graph 1900 illustrated in FIG. 19is shown, for didactic purposes, in a two-dimensional visual maprepresentation. In particular embodiments, a social-networking system1860, client system 1830, or third-party system 1870 may access socialgraph 1900 and related social-graph information for suitableapplications. The nodes and edges of social graph 1900 may be stored asdata objects, for example, in a data store (such as a social-graphdatabase). Such a data store may include one or more searchable orqueryable indexes of nodes or edges of social graph 1900.

In particular embodiments, a user node 1902 may correspond to a user ofsocial-networking system 1860. As an example and not by way oflimitation, a user may be an individual (human user), an entity (e.g.,an enterprise, business, or third-party application), or a group (e.g.,of individuals or entities) that interacts or communicates with or oversocial-networking system 1860. In particular embodiments, when a userregisters for an account with social-networking system 1860,social-networking system 1860 may create a user node 1902 correspondingto the user, and store the user node 1902 in one or more data stores.Users and user nodes 1902 described herein may, where appropriate, referto registered users and user nodes 1902 associated with registeredusers. In addition or as an alternative, users and user nodes 1902described herein may, where appropriate, refer to users that have notregistered with social-networking system 1860. In particularembodiments, a user node 1902 may be associated with informationprovided by a user or information gathered by various systems, includingsocial-networking system 1860. As an example and not by way oflimitation, a user may provide his or her name, profile picture, contactinformation, birth date, sex, marital status, family status, employment,education background, preferences, interests, or other demographicinformation. In particular embodiments, a user node 1902 may beassociated with one or more data objects corresponding to informationassociated with a user. In particular embodiments, a user node 1902 maycorrespond to one or more webpages.

In particular embodiments, a concept node 1904 may correspond to aconcept. As an example and not by way of limitation, a concept maycorrespond to a place (such as, for example, a movie theater,restaurant, landmark, or city); a website (such as, for example, awebsite associated with social-network system 1860 or a third-partywebsite associated with a web-application server); an entity (such as,for example, a person, business, group, sports team, or celebrity); aresource (such as, for example, an audio file, video file, digitalphoto, text file, structured document, or application) which may belocated within social-networking system 1860 or on an external server,such as a web-application server; real or intellectual property (suchas, for example, a sculpture, painting, movie, game, song, idea,photograph, or written work); a game; an activity; an idea or theory; anobject in a augmented/virtual reality environment; another suitableconcept; or two or more such concepts. A concept node 1904 may beassociated with information of a concept provided by a user orinformation gathered by various systems, including social-networkingsystem 1860. As an example and not by way of limitation, information ofa concept may include a name or a title; one or more images (e.g., animage of the cover page of a book); a location (e.g., an address or ageographical location); a website (which may be associated with a URL);contact information (e.g., a phone number or an email address); othersuitable concept information; or any suitable combination of suchinformation. In particular embodiments, a concept node 1904 may beassociated with one or more data objects corresponding to informationassociated with concept node 1904. In particular embodiments, a conceptnode 1904 may correspond to one or more webpages.

In particular embodiments, a node in social graph 1900 may represent orbe represented by a webpage (which may be referred to as a “profilepage”). Profile pages may be hosted by or accessible tosocial-networking system 1860. Profile pages may also be hosted onthird-party websites associated with a third-party system 1870. As anexample and not by way of limitation, a profile page corresponding to aparticular external webpage may be the particular external webpage andthe profile page may correspond to a particular concept node 1904.Profile pages may be viewable by all or a selected subset of otherusers. As an example and not by way of limitation, a user node 1902 mayhave a corresponding user-profile page in which the corresponding usermay add content, make declarations, or otherwise express himself orherself. As another example and not by way of limitation, a concept node1904 may have a corresponding concept-profile page in which one or moreusers may add content, make declarations, or express themselves,particularly in relation to the concept corresponding to concept node1904.

In particular embodiments, a concept node 1904 may represent athird-party webpage or resource hosted by a third-party system 1870. Thethird-party webpage or resource may include, among other elements,content, a selectable or other icon, or other inter-actable object(which may be implemented, for example, in JavaScript, AJAX, or PHPcodes) representing an action or activity. As an example and not by wayof limitation, a third-party webpage may include a selectable icon suchas “like,” “check-in,” “eat,” “recommend,” or another suitable action oractivity. A user viewing the third-party webpage may perform an actionby selecting one of the icons (e.g., “check-in”), causing a clientsystem 1830 to send to social-networking system 1860 a messageindicating the user's action. In response to the message,social-networking system 1860 may create an edge (e.g., a check-in-typeedge) between a user node 1902 corresponding to the user and a conceptnode 1904 corresponding to the third-party webpage or resource and storeedge 1906 in one or more data stores.

In particular embodiments, a pair of nodes in social graph 1900 may beconnected to each other by one or more edges 1906. An edge 1906connecting a pair of nodes may represent a relationship between the pairof nodes. In particular embodiments, an edge 1906 may include orrepresent one or more data objects or attributes corresponding to therelationship between a pair of nodes. As an example and not by way oflimitation, a first user may indicate that a second user is a “friend”of the first user. In response to this indication, social-networkingsystem 1860 may send a “friend request” to the second user. If thesecond user confirms the “friend request,” social-networking system 1860may create an edge 1906 connecting the first user's user node 1902 tothe second user's user node 1902 in social graph 1900 and store edge1906 as social-graph information in one or more of data stores 1864. Inthe example of FIG. 19, social graph 1900 includes an edge 1906indicating a friend relation between user nodes 1902 of user “A” anduser “B” and an edge indicating a friend relation between user nodes1902 of user “C” and user “B.” Although this disclosure describes orillustrates particular edges 1906 with particular attributes connectingparticular user nodes 1902, this disclosure contemplates any suitableedges 1906 with any suitable attributes connecting user nodes 1902. Asan example and not by way of limitation, an edge 1906 may represent afriendship, family relationship, business or employment relationship,fan relationship (including, e.g., liking, etc.), follower relationship,visitor relationship (including, e.g., accessing, viewing, checking-in,sharing, etc.), subscriber relationship, superior/subordinaterelationship, reciprocal relationship, non-reciprocal relationship,another suitable type of relationship, or two or more suchrelationships. Moreover, although this disclosure generally describesnodes as being connected, this disclosure also describes users orconcepts as being connected. Herein, references to users or conceptsbeing connected may, where appropriate, refer to the nodes correspondingto those users or concepts being connected in social graph 1900 by oneor more edges 1906.

In particular embodiments, an edge 1906 between a user node 1902 and aconcept node 1904 may represent a particular action or activityperformed by a user associated with user node 1902 toward a conceptassociated with a concept node 1904. As an example and not by way oflimitation, as illustrated in FIG. 19, a user may “like,” “attended,”“played,” “listened,” “cooked,” “worked at,” or “watched” a concept,each of which may correspond to an edge type or subtype. Aconcept-profile page corresponding to a concept node 1904 may include,for example, a selectable “check in” icon (such as, for example, aclickable “check in” icon) or a selectable “add to favorites” icon.Similarly, after a user clicks these icons, social-networking system1860 may create a “favorite” edge or a “check in” edge in response to auser's action corresponding to a respective action. As another exampleand not by way of limitation, a user (user “C”) may listen to aparticular song (“Imagine”) using a particular application (SPOTIFY,which is an online music application). In this case, social-networkingsystem 1860 may create a “listened” edge 1906 and a “used” edge (asillustrated in FIG. 19) between user nodes 1902 corresponding to theuser and concept nodes 1904 corresponding to the song and application toindicate that the user listened to the song and used the application.Moreover, social-networking system 1860 may create a “played” edge 1906(as illustrated in FIG. 19) between concept nodes 1904 corresponding tothe song and the application to indicate that the particular song wasplayed by the particular application. In this case, “played” edge 1906corresponds to an action performed by an external application (SPOTIFY)on an external audio file (the song “Imagine”). Although this disclosuredescribes particular edges 1906 with particular attributes connectinguser nodes 1902 and concept nodes 1904, this disclosure contemplates anysuitable edges 1906 with any suitable attributes connecting user nodes1902 and concept nodes 1904. Moreover, although this disclosuredescribes edges between a user node 1902 and a concept node 1904representing a single relationship, this disclosure contemplates edgesbetween a user node 1902 and a concept node 1904 representing one ormore relationships. As an example and not by way of limitation, an edge1906 may represent both that a user likes and has used at a particularconcept. Alternatively, another edge 1906 may represent each type ofrelationship (or multiples of a single relationship) between a user node1902 and a concept node 1904 (as illustrated in FIG. 19 between usernode 1902 for user “E” and concept node 1904 for “SPOTIFY”).

In particular embodiments, social-networking system 1860 may create anedge 1906 between a user node 1902 and a concept node 1904 in socialgraph 1900. As an example and not by way of limitation, a user viewing aconcept-profile page (such as, for example, by using a web browser or aspecial-purpose application hosted by the user's client system 1830) mayindicate that he or she likes the concept represented by the conceptnode 1904 by clicking or selecting a “Like” icon, which may cause theuser's client system 1830 to send to social-networking system 1860 amessage indicating the user's liking of the concept associated with theconcept-profile page. In response to the message, social-networkingsystem 1860 may create an edge 1906 between user node 1902 associatedwith the user and concept node 1904, as illustrated by “like” edge 1906between the user and concept node 1904. In particular embodiments,social-networking system 1860 may store an edge 1906 in one or more datastores. In particular embodiments, an edge 1906 may be automaticallyformed by social-networking system 1860 in response to a particular useraction. As an example and not by way of limitation, if a first useruploads a picture, watches a movie, or listens to a song, an edge 1906may be formed between user node 1902 corresponding to the first user andconcept nodes 1904 corresponding to those concepts. Although thisdisclosure describes forming particular edges 1906 in particularmanners, this disclosure contemplates forming any suitable edges 1906 inany suitable manner.

In particular embodiments, an advertisement may be text (which may beHTML-linked), one or more images (which may be HTML-linked), one or morevideos, audio, other suitable digital object files, a suitablecombination of these, or any other suitable advertisement in anysuitable digital format presented on one or more webpages, in one ormore e-mails, or in connection with search results requested by a user.In addition or as an alternative, an advertisement may be one or moresponsored stories (e.g., a news-feed or ticker item on social-networkingsystem 1860). A sponsored story may be a social action by a user (suchas “liking” a page, “liking” or commenting on a post on a page, RSVPingto an event associated with a page, voting on a question posted on apage, checking in to a place, using an application or playing a game, or“liking” or sharing a website) that an advertiser promotes, for example,by having the social action presented within a pre-determined area of aprofile page of a user or other page, presented with additionalinformation associated with the advertiser, bumped up or otherwisehighlighted within news feeds or tickers of other users, or otherwisepromoted. The advertiser may pay to have the social action promoted. Asan example and not by way of limitation, advertisements may be includedamong the search results of a search-results page, where sponsoredcontent is promoted over non-sponsored content.

In particular embodiments, an advertisement may be requested for displaywithin social-networking-system webpages, third-party webpages, or otherpages. An advertisement may be displayed in a dedicated portion of apage, such as in a banner area at the top of the page, in a column atthe side of the page, in a GUI of the page, in a pop-up window, in adrop-down menu, in an input field of the page, over the top of contentof the page, or elsewhere with respect to the page. In addition or as analternative, an advertisement may be displayed within an application. Anadvertisement may be displayed within dedicated pages, requiring theuser to interact with or watch the advertisement before the user mayaccess a page or utilize an application. The user may, for example viewthe advertisement through a web browser.

A user may interact with an advertisement in any suitable manner. Theuser may click or otherwise select the advertisement. By selecting theadvertisement, the user may be directed to (or a browser or otherapplication being used by the user) a page associated with theadvertisement. At the page associated with the advertisement, the usermay take additional actions, such as purchasing a product or serviceassociated with the advertisement, receiving information associated withthe advertisement, or subscribing to a newsletter associated with theadvertisement. An advertisement with audio or video may be played byselecting a component of the advertisement (like a “play button”).Alternatively, by selecting the advertisement, social-networking system1860 may execute or modify a particular action of the user.

An advertisement may also include social-networking-system functionalitythat a user may interact with. As an example and not by way oflimitation, an advertisement may enable a user to “like” or otherwiseendorse the advertisement by selecting an icon or link associated withendorsement. As another example and not by way of limitation, anadvertisement may enable a user to search (e.g., by executing a query)for content related to the advertiser. Similarly, a user may share theadvertisement with another user (e.g., through social-networking system1860) or RSVP (e.g., through social-networking system 1860) to an eventassociated with the advertisement. In addition or as an alternative, anadvertisement may include social-networking-system content directed tothe user. As an example and not by way of limitation, an advertisementmay display information about a friend of the user withinsocial-networking system 1860 who has taken an action associated withthe subject matter of the advertisement.

FIG. 20 illustrates an example computer system 2000. In particularembodiments, one or more computer systems 2000 perform one or more stepsof one or more methods described or illustrated herein. In particularembodiments, one or more computer systems 2000 provide functionalitydescribed or illustrated herein. In particular embodiments, softwarerunning on one or more computer systems 2000 performs one or more stepsof one or more methods described or illustrated herein or providesfunctionality described or illustrated herein. Particular embodimentsinclude one or more portions of one or more computer systems 2000.Herein, reference to a computer system may encompass a computing device,and vice versa, where appropriate. Moreover, reference to a computersystem may encompass one or more computer systems, where appropriate.

This disclosure contemplates any suitable number of computer systems2000. This disclosure contemplates computer system 2000 taking anysuitable physical form. As example and not by way of limitation,computer system 2000 may be an embedded computer system, asystem-on-chip (SOC), a single-board computer system (SBC) (such as, forexample, a computer-on-module (COM) or system-on-module (SOM)), adesktop computer system, a laptop or notebook computer system, aninteractive kiosk, a mainframe, a mesh of computer systems, a mobiletelephone, a personal digital assistant (PDA), a server, a tabletcomputer system, an augmented/virtual reality device, or a combinationof two or more of these. Where appropriate, computer system 2000 mayinclude one or more computer systems 2000; be unitary or distributed;span multiple locations; span multiple machines; span multiple datacenters; or reside in a cloud, which may include one or more cloudcomponents in one or more networks. Where appropriate, one or morecomputer systems 2000 may perform without substantial spatial ortemporal limitation one or more steps of one or more methods describedor illustrated herein. As an example and not by way of limitation, oneor more computer systems 2000 may perform in real time or in batch modeone or more steps of one or more methods described or illustratedherein. One or more computer systems 2000 may perform at different timesor at different locations one or more steps of one or more methodsdescribed or illustrated herein, where appropriate.

In particular embodiments, computer system 2000 includes a processor2002, memory 2004, storage 2006, an input/output (I/O) interface 2008, acommunication interface 2010, and a bus 2012. Although this disclosuredescribes and illustrates a particular computer system having aparticular number of particular components in a particular arrangement,this disclosure contemplates any suitable computer system having anysuitable number of any suitable components in any suitable arrangement.

In particular embodiments, processor 2002 includes hardware forexecuting instructions, such as those making up a computer program. Asan example and not by way of limitation, to execute instructions,processor 2002 may retrieve (or fetch) the instructions from an internalregister, an internal cache, memory 2004, or storage 2006; decode andexecute them; and then write one or more results to an internalregister, an internal cache, memory 2004, or storage 2006. In particularembodiments, processor 2002 may include one or more internal caches fordata, instructions, or addresses. This disclosure contemplates processor2002 including any suitable number of any suitable internal caches,where appropriate. As an example and not by way of limitation, processor2002 may include one or more instruction caches, one or more datacaches, and one or more translation lookaside buffers (TLBs).Instructions in the instruction caches may be copies of instructions inmemory 2004 or storage 2006, and the instruction caches may speed upretrieval of those instructions by processor 2002. Data in the datacaches may be copies of data in memory 2004 or storage 2006 forinstructions executing at processor 2002 to operate on; the results ofprevious instructions executed at processor 2002 for access bysubsequent instructions executing at processor 2002 or for writing tomemory 2004 or storage 2006; or other suitable data. The data caches mayspeed up read or write operations by processor 2002. The TLBs may speedup virtual-address translation for processor 2002. In particularembodiments, processor 2002 may include one or more internal registersfor data, instructions, or addresses. This disclosure contemplatesprocessor 2002 including any suitable number of any suitable internalregisters, where appropriate. Where appropriate, processor 2002 mayinclude one or more arithmetic logic units (ALUs); be a multi-coreprocessor; or include one or more processors 2002. Although thisdisclosure describes and illustrates a particular processor, thisdisclosure contemplates any suitable processor.

In particular embodiments, memory 2004 includes main memory for storinginstructions for processor 2002 to execute or data for processor 2002 tooperate on. As an example and not by way of limitation, computer system2000 may load instructions from storage 2006 or another source (such as,for example, another computer system 2000) to memory 2004. Processor2002 may then load the instructions from memory 2004 to an internalregister or internal cache. To execute the instructions, processor 2002may retrieve the instructions from the internal register or internalcache and decode them. During or after execution of the instructions,processor 2002 may write one or more results (which may be intermediateor final results) to the internal register or internal cache. Processor2002 may then write one or more of those results to memory 2004. Inparticular embodiments, processor 2002 executes only instructions in oneor more internal registers or internal caches or in memory 2004 (asopposed to storage 2006 or elsewhere) and operates only on data in oneor more internal registers or internal caches or in memory 2004 (asopposed to storage 2006 or elsewhere). One or more memory buses (whichmay each include an address bus and a data bus) may couple processor2002 to memory 2004. Bus 2012 may include one or more memory buses, asdescribed below. In particular embodiments, one or more memorymanagement units (MMUs) reside between processor 2002 and memory 2004and facilitate accesses to memory 2004 requested by processor 2002. Inparticular embodiments, memory 2004 includes random access memory (RAM).This RAM may be volatile memory, where appropriate. Where appropriate,this RAM may be dynamic RAM (DRAM) or static RAM (SRAM). Moreover, whereappropriate, this RAM may be single-ported or multi-ported RAM. Thisdisclosure contemplates any suitable RAM. Memory 2004 may include one ormore memories 2004, where appropriate. Although this disclosuredescribes and illustrates particular memory, this disclosurecontemplates any suitable memory.

In particular embodiments, storage 2006 includes mass storage for dataor instructions. As an example and not by way of limitation, storage2006 may include a hard disk drive (HDD), a floppy disk drive, flashmemory, an optical disc, a magneto-optical disc, magnetic tape, or aUniversal Serial Bus (USB) drive or a combination of two or more ofthese. Storage 2006 may include removable or non-removable (or fixed)media, where appropriate. Storage 2006 may be internal or external tocomputer system 2000, where appropriate. In particular embodiments,storage 2006 is non-volatile, solid-state memory. In particularembodiments, storage 2006 includes read-only memory (ROM). Whereappropriate, this ROM may be mask-programmed ROM, programmable ROM(PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM),electrically alterable ROM (EAROM), or flash memory or a combination oftwo or more of these. This disclosure contemplates mass storage 2006taking any suitable physical form. Storage 2006 may include one or morestorage control units facilitating communication between processor 2002and storage 2006, where appropriate. Where appropriate, storage 2006 mayinclude one or more storages 2006. Although this disclosure describesand illustrates particular storage, this disclosure contemplates anysuitable storage.

In particular embodiments, I/O interface 2008 includes hardware,software, or both, providing one or more interfaces for communicationbetween computer system 2000 and one or more I/O devices. Computersystem 2000 may include one or more of these I/O devices, whereappropriate. One or more of these I/O devices may enable communicationbetween a person and computer system 2000. As an example and not by wayof limitation, an I/O device may include a keyboard, keypad, microphone,monitor, mouse, printer, scanner, speaker, still camera, stylus, tablet,touch screen, trackball, video camera, another suitable I/O device or acombination of two or more of these. An I/O device may include one ormore sensors. This disclosure contemplates any suitable I/O devices andany suitable I/O interfaces 2008 for them. Where appropriate, I/Ointerface 2008 may include one or more device or software driversenabling processor 2002 to drive one or more of these I/O devices. I/Ointerface 2008 may include one or more I/O interfaces 2008, whereappropriate. Although this disclosure describes and illustrates aparticular I/O interface, this disclosure contemplates any suitable I/Ointerface.

In particular embodiments, communication interface 2010 includeshardware, software, or both providing one or more interfaces forcommunication (such as, for example, packet-based communication) betweencomputer system 2000 and one or more other computer systems 2000 or oneor more networks. As an example and not by way of limitation,communication interface 2010 may include a network interface controller(NIC) or network adapter for communicating with an Ethernet or otherwire-based network or a wireless NIC (WNIC) or wireless adapter forcommunicating with a wireless network, such as a WI-FI network. Thisdisclosure contemplates any suitable network and any suitablecommunication interface 2010 for it. As an example and not by way oflimitation, computer system 2000 may communicate with an ad hoc network,a personal area network (PAN), a local area network (LAN), a wide areanetwork (WAN), a metropolitan area network (MAN), or one or moreportions of the Internet or a combination of two or more of these. Oneor more portions of one or more of these networks may be wired orwireless. As an example, computer system 2000 may communicate with awireless PAN (WPAN) (such as, for example, a BLUETOOTH WPAN), a WI-FInetwork, a WI-MAX network, a cellular telephone network (such as, forexample, a Global System for Mobile Communications (GSM) network), orother suitable wireless network or a combination of two or more ofthese. Computer system 2000 may include any suitable communicationinterface 2010 for any of these networks, where appropriate.Communication interface 2010 may include one or more communicationinterfaces 2010, where appropriate. Although this disclosure describesand illustrates a particular communication interface, this disclosurecontemplates any suitable communication interface.

In particular embodiments, bus 2012 includes hardware, software, or bothcoupling components of computer system 2000 to each other. As an exampleand not by way of limitation, bus 2012 may include an AcceleratedGraphics Port (AGP) or other graphics bus, an Enhanced Industry StandardArchitecture (EISA) bus, a front-side bus (FSB), a HYPERTRANSPORT (HT)interconnect, an Industry Standard Architecture (ISA) bus, an INFINIBANDinterconnect, a low-pin-count (LPC) bus, a memory bus, a Micro ChannelArchitecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, aPCI-Express (PCIe) bus, a serial advanced technology attachment (SATA)bus, a Video Electronics Standards Association local (VLB) bus, oranother suitable bus or a combination of two or more of these. Bus 2012may include one or more buses 2012, where appropriate. Although thisdisclosure describes and illustrates a particular bus, this disclosurecontemplates any suitable bus or interconnect.

Herein, a computer-readable non-transitory storage medium or media mayinclude one or more semiconductor-based or other integrated circuits(ICs) (such, as for example, field-programmable gate arrays (FPGAs) orapplication-specific ICs (ASICs)), hard disk drives (HDDs), hybrid harddrives (HHDs), optical discs, optical disc drives (ODDs),magneto-optical discs, magneto-optical drives, floppy diskettes, floppydisk drives (FDDs), magnetic tapes, solid-state drives (SSDs),RAM-drives, SECURE DIGITAL cards or drives, any other suitablecomputer-readable non-transitory storage media, or any suitablecombination of two or more of these, where appropriate. Acomputer-readable non-transitory storage medium may be volatile,non-volatile, or a combination of volatile and non-volatile, whereappropriate.

Herein, “or” is inclusive and not exclusive, unless expressly indicatedotherwise or indicated otherwise by context. Therefore, herein, “A or B”means “A, B, or both,” unless expressly indicated otherwise or indicatedotherwise by context. Moreover, “and” is both joint and several, unlessexpressly indicated otherwise or indicated otherwise by context.Therefore, herein, “A and B” means “A and B, jointly or severally,”unless expressly indicated otherwise or indicated otherwise by context.

The scope of this disclosure encompasses all changes, substitutions,variations, alterations, and modifications to the example embodimentsdescribed or illustrated herein that a person having ordinary skill inthe art would comprehend. The scope of this disclosure is not limited tothe example embodiments described or illustrated herein. Moreover,although this disclosure describes and illustrates respectiveembodiments herein as including particular components, elements,feature, functions, operations, or steps, any of these embodiments mayinclude any combination or permutation of any of the components,elements, features, functions, operations, or steps described orillustrated anywhere herein that a person having ordinary skill in theart would comprehend. Furthermore, reference in the appended claims toan apparatus or system or a component of an apparatus or system beingadapted to, arranged to, capable of, configured to, enabled to, operableto, or operative to perform a particular function encompasses thatapparatus, system, component, whether or not it or that particularfunction is activated, turned on, or unlocked, as long as thatapparatus, system, or component is so adapted, arranged, capable,configured, enabled, operable, or operative. Additionally, although thisdisclosure describes or illustrates particular embodiments as providingparticular advantages, particular embodiments may provide none, some, orall of these advantages.

What is claimed is:
 1. A method comprising: by a computing device,accessing a neural network having a module comprising embedding-poolingblocks, the module having a first input and a second input; and by thecomputing device, using the module to: process the first input togenerate a plurality of first latent vector representations of the firstinput by submitting the first input to each of a first plurality of theembedding-pooling blocks, the plurality of first latent vectorrepresentations being different from each other and being respectivelygenerated by the first plurality of the embedding-pooling blocks,wherein a number of the first plurality of the embedding-pooling blocksis determined based on a density of the first input; process the secondinput to generate a plurality of second latent vector representations ofthe second input by submitting the second input to each of a secondplurality of the embedding-pooling blocks, the plurality of secondlatent vector representations being different from each other and beingrespectively generated by the second plurality of the embedding-poolingblocks, wherein a number of the second plurality of theembedding-pooling blocks is determined based on a density of the secondinput; determine unique pairwise combinations of latent vectorrepresentations, wherein each unique pairwise combination compriseslatent vector representations selected from (1) the plurality of firstlatent vector representations of the first input and (2) the pluralityof second latent vector representations of the second input; modelpairwise interactions between the unique pairwise combinations of latentvector representations; and produce an intermediate output by combiningresults of the modeled pairwise interactions.
 2. The method of claim 1,wherein the pairwise interactions are modeled by dot product operationsor cosine similarity operations.
 3. The method of claim 1, whereinresults of the modeled pairwise interactions are combined by beingconcatenated together.
 4. The method of claim 1, wherein the first andsecond latent vector representations are generated using lineartransformation or embedding operations.
 5. The method of claim 1,wherein the plurality of second latent vector representations of thesecond input are generated based on different embeddings associated withthe second input.
 6. The method of claim 5, wherein the differentembeddings represent different related meanings of the second input. 7.The method of claim 1, wherein the first input and second input are bothdense feature vectors or both sparse feature vectors.
 8. The method ofclaim 1, wherein the first input is a dense feature vector, the secondinput is a sparse feature vector, and the dense feature vector isassociated with a greater number of latent vector representations thanthe sparse feature vector.
 9. The method of claim 1, wherein the neuralnetwork has a plurality of said modules, including a first module and asecond module, and the intermediate output of the first module being fedforward to the first input of the second module.
 10. The method of claim9, wherein the second input of the second module is coupled to receivethe same second input of the first module, the first module and secondmodule generating a different, plurality of different second latentvector representations for their respective second input.
 11. The methodof claim 9, wherein the second input of the second module receives aninput different than the second input of the first module.
 12. Themethod of claim 1, wherein the module is a first module, the neuralnetwork further comprises a second module different than the firstmodule, the second module having a third input, a fourth input, and afifth input, the method further comprising: by the computing device, thesecond module generating one third latent vector representation of thethird input, one fourth latent vector representation of the fourthinput, and one fifth latent vector representation of the fifth input; bythe computing device, the second module modeling second pairwiseinteractions between unique pairwise combination of the third latentvector representation, the fourth latent vector representation, and thefifth latent vector representation; and by the computing device, thesecond module producing a second intermediate output by combiningresults of the second modeled pairwise interactions with the thirdinput; wherein the intermediate output of the first module is fedforward to one of the third, fourth or fifth input of the second module.13. The method of claim 12, wherein: the third input is a dense featurevector and the fourth and fifth inputs are both sparse feature vectors;the neural network has a plurality of said second modules arranged in afeedforward arrangement; and the second intermediate output of onesecond module feeds into the third input of the next second module inthe feedforward arrangement.
 14. The method of claim 1, wherein: theplurality of first latent vector representations correspond to differentrelated meanings of the first input; the plurality of second latentvector representations correspond to different related meanings of thesecond input; and the neural network is executable on a computer networkhaving a network client, and execution of the neural network is used toprovide a ranking of content determined to be of interest to the networkclient based on pairwise interactions of related meanings of the firstinput and second input.
 15. One or more computer-readable non-transitorystorage media embodying software that is operable when executed to:access a neural network having a module comprising embedding-poolingblocks, the module being a module of nodes and having a first input anda second input; and use the module to: process the first input togenerate a plurality of first latent vector representations of the firstinput by submitting the first input to each of a first plurality of theembedding-pooling blocks, the plurality of first latent vectorrepresentations being different from each other and being respectivelygenerated by the first plurality of the embedding-pooling blocks,wherein a number of the first plurality of the embedding-pooling blocksis determined based on a density of the first input; process the secondinput to generate a plurality of second latent vector representations ofthe second input by submitting the second input to each of a secondplurality of the embedding-pooling blocks, the plurality of secondlatent vector representations being different from each other and beingrespectively generated by the second plurality of the embedding-poolingblocks, wherein a number of the second plurality of theembedding-pooling blocks is determined based on a density of the secondinput; determine unique pairwise combinations of latent vectorrepresentations, wherein each unique pairwise combination compriseslatent vector representations selected from (1) the plurality of firstlatent vector representations of the first input and (2) the pluralityof second latent vector representations of the second input; modelpairwise interactions between the unique pairwise combinations of latentvector representations; and produce an intermediate output by combiningresults of the modeled pairwise interactions.
 16. The media of claim 15,wherein the module is a first module, the neural network furthercomprises a second module different than the first module, the secondmodule having a third input, a fourth input, and a fifth input, thesoftware being further operable when executed to: generate one thirdlatent vector representation of the third input, one fourth latentvector representation of the fourth input, and one fifth latent vectorrepresentation of the fifth input; model second pairwise interactionsbetween unique pairwise combination of the third latent vectorrepresentation, the fourth latent vector representation, and the fifthlatent vector representation; and produce a second intermediate outputby combining results of the second modeled pairwise interactions withthe third input; wherein the intermediate output of the first module isfed forward to one of the third, fourth or fifth input of the secondmodule.
 17. The media of claim 15, wherein: the second input is a sparsefeature vector; the plurality of second latent vector representations ofthe second input are based on different embeddings associated with thesecond input, each embedding being trained to represent a differentrelated meaning to the second input; the plurality of first latentvector representations correspond to different related meanings of thefirst input; and the neural network is executable on a computer networkhaving a network client, and execution of the neural network is used toprovide a ranking of content determined to be of interest to the networkclient based on pairwise interactions of related meanings of the firstinput and second input.
 18. A system comprising: one or more processors;and one or more computer-readable non-transitory storage media coupledto one or more of the processors and comprising instructions operablewhen executed by one or more of the processors to cause the system to:access a neural network having a module comprising embedding-poolingblocks, the module being a module of nodes and having a first input anda second input; and use the module to: process the first input togenerate a plurality of first latent vector representations of the firstinput by submitting the first input to each of a first plurality of theembedding-pooling blocks, the plurality of first latent vectorrepresentations being different from each other and being respectivelygenerated by the first plurality of the embedding-pooling blocks,wherein a number of the first plurality of the embedding-pooling blocksis determined based on a density of the first input; process the secondinput to generate a plurality of second latent vector representations ofthe second input by submitting the second input to each of a secondplurality of the embedding-pooling blocks, the plurality of secondlatent vector representations being different from each other and beingrespectively generated by the second plurality of the embedding-poolingblocks, wherein a number of the second plurality of theembedding-pooling blocks is determined based on a density of the secondinput; determine unique pairwise combinations of latent vectorrepresentations, wherein each unique pairwise combination compriseslatent vector representations selected from (1) the plurality of firstlatent vector representations of the first input and (2) the pluralityof second latent vector representations of the second input; modelpairwise interactions between the unique pairwise combinations of latentvector representations; and produce an intermediate output by combiningresults of the modeled pairwise interactions.
 19. The system of claim18, wherein the module is a first module, the neural network furthercomprises a second module different than the first module, the secondmodule having a third input, a fourth input, and a fifth input, theinstructions being further operable when executed by one or more of theprocessors to cause the system to: generate one third latent vectorrepresentation of the third input, one fourth latent vectorrepresentation of the fourth input, and one fifth latent vectorrepresentation of the fifth input; model second pairwise interactionsbetween unique pairwise combination of the third latent vectorrepresentation, the fourth latent vector representation, and the fifthlatent vector representation; and produce a second intermediate outputby combining results of the second modeled pairwise interactions withthe third input; wherein the intermediate output of the first module isfed forward to one of the third, fourth or fifth input of the secondmodule.
 20. The system of claim 18, wherein: the second input is asparse feature vector; the plurality of second latent vectorrepresentations of the second input are based on different embeddingsassociated with the second input, each embedding being trained torepresent a different related meaning to the second input; the pluralityof first latent vector representations correspond to different relatedmeanings of the first input; and the neural network is executable on acomputer network having a network client, and execution of the neuralnetwork is used to provide a ranking of content determined to be ofinterest to the network client based on pairwise interactions of relatedmeanings of the first input and second input.